mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Return correct 'Browser' value for DevTools remote debugging (issue #2300)
This commit is contained in:
@@ -229,24 +229,24 @@ void CefContentClient::AddAdditionalSchemes(Schemes* schemes) {
|
|||||||
scheme_info_list_locked_ = true;
|
scheme_info_list_locked_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CefContentClient::GetUserAgent() const {
|
std::string CefContentClient::GetProduct() const {
|
||||||
std::string product_version;
|
const base::CommandLine* command_line =
|
||||||
|
base::CommandLine::ForCurrentProcess();
|
||||||
|
if (command_line->HasSwitch(switches::kProductVersion))
|
||||||
|
return command_line->GetSwitchValueASCII(switches::kProductVersion);
|
||||||
|
|
||||||
|
return base::StringPrintf("Chrome/%d.%d.%d.%d", CHROME_VERSION_MAJOR,
|
||||||
|
CHROME_VERSION_MINOR, CHROME_VERSION_BUILD,
|
||||||
|
CHROME_VERSION_PATCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string CefContentClient::GetUserAgent() const {
|
||||||
const base::CommandLine* command_line =
|
const base::CommandLine* command_line =
|
||||||
base::CommandLine::ForCurrentProcess();
|
base::CommandLine::ForCurrentProcess();
|
||||||
if (command_line->HasSwitch(switches::kUserAgent))
|
if (command_line->HasSwitch(switches::kUserAgent))
|
||||||
return command_line->GetSwitchValueASCII(switches::kUserAgent);
|
return command_line->GetSwitchValueASCII(switches::kUserAgent);
|
||||||
|
|
||||||
if (command_line->HasSwitch(switches::kProductVersion)) {
|
return content::BuildUserAgentFromProduct(GetProduct());
|
||||||
product_version =
|
|
||||||
command_line->GetSwitchValueASCII(switches::kProductVersion);
|
|
||||||
} else {
|
|
||||||
product_version = base::StringPrintf(
|
|
||||||
"Chrome/%d.%d.%d.%d", CHROME_VERSION_MAJOR, CHROME_VERSION_MINOR,
|
|
||||||
CHROME_VERSION_BUILD, CHROME_VERSION_PATCH);
|
|
||||||
}
|
|
||||||
|
|
||||||
return content::BuildUserAgentFromProduct(product_version);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base::string16 CefContentClient::GetLocalizedString(int message_id) const {
|
base::string16 CefContentClient::GetLocalizedString(int message_id) const {
|
||||||
|
@@ -34,6 +34,7 @@ class CefContentClient : public content::ContentClient,
|
|||||||
void AddPepperPlugins(
|
void AddPepperPlugins(
|
||||||
std::vector<content::PepperPluginInfo>* plugins) override;
|
std::vector<content::PepperPluginInfo>* plugins) override;
|
||||||
void AddAdditionalSchemes(Schemes* schemes) override;
|
void AddAdditionalSchemes(Schemes* schemes) override;
|
||||||
|
std::string GetProduct() const override;
|
||||||
std::string GetUserAgent() const override;
|
std::string GetUserAgent() const override;
|
||||||
base::string16 GetLocalizedString(int message_id) const override;
|
base::string16 GetLocalizedString(int message_id) const override;
|
||||||
base::StringPiece GetDataResource(
|
base::StringPiece GetDataResource(
|
||||||
|
Reference in New Issue
Block a user