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

Unified Diff: extensions/shell/common/shell_content_client.cc

Issue 505403003: app_shell: Add version number in user agent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « extensions/shell/app_shell.gyp ('k') | extensions/shell/common/shell_content_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/common/shell_content_client.cc
diff --git a/extensions/shell/common/shell_content_client.cc b/extensions/shell/common/shell_content_client.cc
index 47f99bc9dc80082ba8ab27d5220de137ab2d9395..ff51a83ba70fc9007935b604123e8f465a296dd1 100644
--- a/extensions/shell/common/shell_content_client.cc
+++ b/extensions/shell/common/shell_content_client.cc
@@ -8,6 +8,7 @@
#include "base/strings/utf_string_conversions.h"
#include "content/public/common/user_agent.h"
#include "extensions/common/constants.h"
+#include "extensions/shell/common/version.h" // Generated file.
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -83,9 +84,9 @@ void ShellContentClient::AddAdditionalSchemes(
}
std::string ShellContentClient::GetUserAgent() const {
- // TODO(derat): Figure out what this should be for app_shell and determine
- // whether we need to include a version number to placate browser sniffing.
- return content::BuildUserAgentFromProduct("Chrome");
+ // Must contain a user agent string for version sniffing. For example,
+ // pluginless WebRTC Hangouts checks the Chrome version number.
+ return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION);
}
base::string16 ShellContentClient::GetLocalizedString(int message_id) const {
« no previous file with comments | « extensions/shell/app_shell.gyp ('k') | extensions/shell/common/shell_content_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698