|
@@ -72,7 +72,7 @@ namespace Chromium {
|
|
|
|
|
|
void CModTools::InitCModTools(CEntityBase* pEntity) {
|
|
|
this->m_pEntity = pEntity;
|
|
|
- m_UseUOSBrowser = false;
|
|
|
+ m_UseUOSBrowser = 0;
|
|
|
m_isGuardMainBrowser = false;
|
|
|
CSmartPointer<IConfigInfo> spConfig;
|
|
|
ErrorCodeEnum Error = m_pEntity->GetFunction()->OpenConfig(Config_Root, spConfig);
|
|
@@ -451,19 +451,25 @@ namespace Chromium {
|
|
|
|
|
|
std::string CModTools::generateAdCmd(std::string AdUrl) {
|
|
|
|
|
|
+ CSimpleStringA strBasePath(true);
|
|
|
+ this->m_pEntity->GetFunction()->GetPath("BaseDir", strBasePath);
|
|
|
+ std::string strPath(strBasePath.GetData());
|
|
|
+ const std::string execute_newbrowser_path = strPath + SPLIT_SLASH_STR + "res" + SPLIT_SLASH_STR + "RunScript" + SPLIT_SLASH_STR + "startBrower.sh";
|
|
|
+ const std::string execute_oldbrowser_path = strPath + SPLIT_SLASH_STR + "res" + SPLIT_SLASH_STR + "RunScript" + SPLIT_SLASH_STR + "startUOSBrower.sh";
|
|
|
+
|
|
|
if (m_UseUOSBrowser == 2) {
|
|
|
|
|
|
- CSimpleStringA strUOSBrowserPath("browser");
|
|
|
+ CSimpleStringA strUOSBrowserPath(execute_newbrowser_path.c_str());
|
|
|
CSimpleStringA strParams(true);
|
|
|
CSimpleStringA tempPath;
|
|
|
this->m_pEntity->GetFunction()->GetPath("Temp", tempPath);
|
|
|
CSimpleStringA cachePath(tempPath);
|
|
|
|
|
|
- cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser2_").Append((+ERR_PAGE_REASON::Ad)._to_string());
|
|
|
+ cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser3_").Append((+ERR_PAGE_REASON::Ad)._to_string());
|
|
|
strParams.Append(" --disk-cache-dir=").Append(cachePath);
|
|
|
strParams.Append(" --disk-cache-size=").Append("2147483647"); //2G
|
|
|
CSimpleStringA usrDataPath(tempPath);
|
|
|
- usrDataPath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowserConfig2_").Append((+ERR_PAGE_REASON::Ad)._to_string());
|
|
|
+ usrDataPath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowserConfig3_").Append((+ERR_PAGE_REASON::Ad)._to_string());
|
|
|
strParams.Append(" --user-data-dir=").Append(usrDataPath);
|
|
|
|
|
|
std::string additionalParam = getAdditionalUOSBrowserSettings(2, 0);
|
|
@@ -489,20 +495,20 @@ namespace Chromium {
|
|
|
|
|
|
if (m_UseUOSBrowser == 1) {
|
|
|
|
|
|
- CSimpleStringA strUOSBrowserPath("uos-browser ");
|
|
|
+ CSimpleStringA strUOSBrowserPath(execute_oldbrowser_path.c_str());
|
|
|
//CSimpleStringA strParams("--new-window --window-position=1280,1024 --window-size=1920,1080");
|
|
|
- CSimpleStringA strParams("--new-window --kiosk --window-position=1280,1024");
|
|
|
+ CSimpleStringA strParams(" --new-window --kiosk --window-position=1280,1024");
|
|
|
|
|
|
CSimpleStringA tempPath;
|
|
|
this->m_pEntity->GetFunction()->GetPath("Temp", tempPath);
|
|
|
CSimpleStringA cachePath(tempPath);
|
|
|
|
|
|
- cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser_").Append((+ERR_PAGE_REASON::Ad)._to_string());
|
|
|
+ cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser4_").Append((+ERR_PAGE_REASON::Ad)._to_string());
|
|
|
strParams.Append(" --disk-cache-dir=").Append(cachePath);
|
|
|
strParams.Append(" --disk-cache-size=").Append("2147483647"); //2G
|
|
|
|
|
|
CSimpleStringA usrDataPath(tempPath);
|
|
|
- usrDataPath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowserConfig_").Append((+ERR_PAGE_REASON::Ad)._to_string());
|
|
|
+ usrDataPath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowserConfig4_").Append((+ERR_PAGE_REASON::Ad)._to_string());
|
|
|
strParams.Append(" --user-data-dir=").Append(usrDataPath);
|
|
|
|
|
|
strParams.Append(" ");
|
|
@@ -594,22 +600,28 @@ namespace Chromium {
|
|
|
|
|
|
std::string CModTools::generateCefclientCmd(bool isExtend, std::string mainUrl)
|
|
|
{
|
|
|
+ CSimpleStringA strBasePath(true);
|
|
|
+ this->m_pEntity->GetFunction()->GetPath("BaseDir", strBasePath);
|
|
|
+ std::string strPath(strBasePath.GetData());
|
|
|
+ const std::string execute_newbrowser_path = strPath + SPLIT_SLASH_STR + "res" + SPLIT_SLASH_STR + "RunScript" + SPLIT_SLASH_STR + "startBrower.sh";
|
|
|
+ const std::string execute_oldbrowser_path = strPath + SPLIT_SLASH_STR + "res" + SPLIT_SLASH_STR + "RunScript" + SPLIT_SLASH_STR + "startUOSBrower.sh";
|
|
|
+
|
|
|
if (m_UseUOSBrowser == 2 && !isExtend) {
|
|
|
|
|
|
- CSimpleStringA strUOSBrowserPath("browser");
|
|
|
+ CSimpleStringA strUOSBrowserPath(execute_newbrowser_path.c_str());
|
|
|
CSimpleStringA strParams(true);
|
|
|
|
|
|
CSimpleStringA tempPath;
|
|
|
this->m_pEntity->GetFunction()->GetPath("Temp", tempPath);
|
|
|
CSimpleStringA cachePath(tempPath);
|
|
|
|
|
|
- cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser2_")
|
|
|
+ cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser3_")
|
|
|
.Append(isExtend ? (+ERR_PAGE_REASON::extend)._to_string() : (+ERR_PAGE_REASON::main)._to_string());
|
|
|
strParams.Append(" --disk-cache-dir=").Append(cachePath);
|
|
|
strParams.Append(" --disk-cache-size=").Append("2147483647"); //2G
|
|
|
|
|
|
CSimpleStringA usrDataPath(tempPath);
|
|
|
- usrDataPath.Append(SPLIT_SLASH_STR).Append("UOSBrowserConfig2_")
|
|
|
+ usrDataPath.Append(SPLIT_SLASH_STR).Append("UOSBrowserConfig3_")
|
|
|
.Append(isExtend ? (+ERR_PAGE_REASON::extend)._to_string() : (+ERR_PAGE_REASON::main)._to_string());
|
|
|
strParams.Append(" --user-data-dir=").Append(usrDataPath);
|
|
|
|
|
@@ -635,20 +647,20 @@ namespace Chromium {
|
|
|
|
|
|
if (m_UseUOSBrowser == 1 && !isExtend) {
|
|
|
|
|
|
- CSimpleStringA strUOSBrowserPath("uos-browser ");
|
|
|
- CSimpleStringA strParams("--new-window --kiosk");
|
|
|
+ CSimpleStringA strUOSBrowserPath(execute_oldbrowser_path.c_str());
|
|
|
+ CSimpleStringA strParams(" --new-window --kiosk");
|
|
|
|
|
|
CSimpleStringA tempPath;
|
|
|
this->m_pEntity->GetFunction()->GetPath("Temp", tempPath);
|
|
|
CSimpleStringA cachePath(tempPath);
|
|
|
|
|
|
- cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser_")
|
|
|
+ cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser4_")
|
|
|
.Append(isExtend ? (+ERR_PAGE_REASON::extend)._to_string() : (+ERR_PAGE_REASON::main)._to_string());
|
|
|
strParams.Append(" --disk-cache-dir=").Append(cachePath);
|
|
|
strParams.Append(" --disk-cache-size=").Append("2147483647"); //2G
|
|
|
|
|
|
CSimpleStringA usrDataPath(tempPath);
|
|
|
- usrDataPath.Append(SPLIT_SLASH_STR).Append("UOSBrowserConfig_")
|
|
|
+ usrDataPath.Append(SPLIT_SLASH_STR).Append("UOSBrowserConfig4_")
|
|
|
.Append(isExtend ? (+ERR_PAGE_REASON::extend)._to_string() : (+ERR_PAGE_REASON::main)._to_string());
|
|
|
strParams.Append(" --user-data-dir=").Append(usrDataPath);
|
|
|
|
|
@@ -1193,8 +1205,14 @@ namespace Chromium {
|
|
|
#if (defined _WIN32 || defined _WIN64)
|
|
|
return 0;
|
|
|
#else
|
|
|
- const std::string execute_newbrowser_path = "/usr/share/browser/browser";
|
|
|
- const std::string execute_oldbrowser_path = "/usr/share/uosbrowser/uosbrowser";
|
|
|
+ const std::string execute_newbrowser_path_check = "/usr/share/browser/browser";
|
|
|
+ const std::string execute_oldbrowser_path_check = "/usr/share/uosbrowser/uosbrowser";
|
|
|
+
|
|
|
+ CSimpleStringA strBasePath(true);
|
|
|
+ this->m_pEntity->GetFunction()->GetPath("BaseDir", strBasePath);
|
|
|
+ std::string strPath(strBasePath.GetData());
|
|
|
+ const std::string execute_newbrowser_path = strPath + SPLIT_SLASH_STR + "res" + SPLIT_SLASH_STR + "RunScript" + SPLIT_SLASH_STR + "startBrower.sh";
|
|
|
+ const std::string execute_oldbrowser_path = strPath + SPLIT_SLASH_STR + "res" + SPLIT_SLASH_STR + "RunScript" + SPLIT_SLASH_STR + "startUOSBrower.sh";
|
|
|
|
|
|
int result(0);
|
|
|
std::string additional("");
|
|
@@ -1203,11 +1221,11 @@ namespace Chromium {
|
|
|
std::string runStr("dpkg -l | grep org.deepin.browser | awk '{print $3}'");
|
|
|
if (SP::Module::Util::ShellExecute(runStr, succStr, errStr)) {
|
|
|
if (succStr.empty()) {
|
|
|
- if (ExistsFileA(execute_oldbrowser_path.c_str())) {
|
|
|
- DbgEx("%s exists!", execute_oldbrowser_path.c_str());
|
|
|
+ if (ExistsFileA(execute_oldbrowser_path_check.c_str())) {
|
|
|
+ DbgEx("%s exists!", execute_oldbrowser_path_check.c_str());
|
|
|
result = 1;
|
|
|
} else {
|
|
|
- DbgEx("%s not exists!", execute_oldbrowser_path.c_str());
|
|
|
+ DbgEx("%s not exists!", execute_oldbrowser_path_check.c_str());
|
|
|
}
|
|
|
LogWarn(Severity_Low, Error_Debug, LOG_EVT_CHROMIUM_BROWSER_LACK_OF_NEWONE, "未安装新浏览器");
|
|
|
} else {
|