Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: trunk/src/chrome/common/chrome_content_client.cc

Issue 192283002: Revert 255858 "Simplify the user agent code some more since afte..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/chrome/common/chrome_content_client.h ('k') | trunk/src/chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/common/chrome_content_client.cc
===================================================================
--- trunk/src/chrome/common/chrome_content_client.cc (revision 255866)
+++ trunk/src/chrome/common/chrome_content_client.cc (working copy)
@@ -417,27 +417,8 @@
#endif // FLAPPER_AVAILABLE
}
-std::string GetProduct() {
- chrome::VersionInfo version_info;
- return version_info.is_valid() ?
- version_info.ProductNameAndVersionForUserAgent() : std::string();
-}
-
} // namespace
-std::string GetUserAgent() {
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kUserAgent))
- return command_line->GetSwitchValueASCII(switches::kUserAgent);
-
- std::string product = GetProduct();
-#if defined(OS_ANDROID)
- if (command_line->HasSwitch(switches::kUseMobileUserAgent))
- product += " Mobile";
-#endif
- return webkit_glue::BuildUserAgentFromProduct(product);
-}
-
void ChromeContentClient::SetActiveURL(const GURL& url) {
base::debug::SetCrashKeyValue(crash_keys::kActiveURL,
url.possibly_invalid_spec());
@@ -499,11 +480,19 @@
}
std::string ChromeContentClient::GetProduct() const {
- return ::GetProduct();
+ chrome::VersionInfo version_info;
+ return version_info.is_valid() ?
+ version_info.ProductNameAndVersionForUserAgent() : std::string();
}
std::string ChromeContentClient::GetUserAgent() const {
- return ::GetUserAgent();
+ std::string product = GetProduct();
+#if defined(OS_ANDROID)
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kUseMobileUserAgent))
+ product += " Mobile";
+#endif
+ return webkit_glue::BuildUserAgentFromProduct(product);
}
base::string16 ChromeContentClient::GetLocalizedString(int message_id) const {
« no previous file with comments | « trunk/src/chrome/common/chrome_content_client.h ('k') | trunk/src/chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698