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

Unified Diff: content/common/user_agent.cc

Issue 186883002: Move user_agent code from webkit/ to content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm build directory 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 | « content/child/npapi/plugin_host.cc ('k') | content/common/user_agent_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/user_agent.cc
diff --git a/webkit/common/user_agent/user_agent_util.cc b/content/common/user_agent.cc
similarity index 93%
rename from webkit/common/user_agent/user_agent_util.cc
rename to content/common/user_agent.cc
index 35e20162e68af1c299f0433b95efbcb305a87c51..9a40b0e58ff2ff0bfd838349c8ebd9f734027ab7 100644
--- a/webkit/common/user_agent/user_agent_util.cc
+++ b/content/common/user_agent.cc
@@ -1,17 +1,18 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/common/user_agent/user_agent_util.h"
+#include "content/public/common/user_agent.h"
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
-#include <sys/utsname.h>
-#endif
-
-#include "base/lazy_instance.h"
+#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/sys_info.h"
+#include "build/build_config.h"
+
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#include <sys/utsname.h>
+#endif
#if defined(OS_WIN)
#include "base/win/windows_version.h"
@@ -20,7 +21,17 @@
// Generated
#include "webkit_version.h" // NOLINT
-namespace webkit_glue {
+namespace content {
+
+namespace {
+
+#if defined(OS_ANDROID)
+std::string GetAndroidDeviceName() {
+ return base::SysInfo::GetDeviceName();
+}
+#endif
+
+} // namespace
std::string GetWebKitVersion() {
return base::StringPrintf("%d.%d (%s)",
@@ -29,15 +40,17 @@ std::string GetWebKitVersion() {
WEBKIT_SVN_REVISION);
}
-std::string GetWebKitRevision() {
- return WEBKIT_SVN_REVISION;
+int GetWebKitMajorVersion() {
+ return WEBKIT_VERSION_MAJOR;
}
-#if defined(OS_ANDROID)
-std::string GetAndroidDeviceName() {
- return base::SysInfo::GetDeviceName();
+int GetWebKitMinorVersion() {
+ return WEBKIT_VERSION_MINOR;
+}
+
+std::string GetWebKitRevision() {
+ return WEBKIT_SVN_REVISION;
}
-#endif
std::string BuildOSCpuInfo() {
std::string os_cpu;
@@ -143,14 +156,6 @@ std::string BuildOSCpuInfo() {
return os_cpu;
}
-int GetWebKitMajorVersion() {
- return WEBKIT_VERSION_MAJOR;
-}
-
-int GetWebKitMinorVersion() {
- return WEBKIT_VERSION_MINOR;
-}
-
std::string BuildUserAgentFromProduct(const std::string& product) {
const char kUserAgentPlatform[] =
#if defined(OS_WIN)
@@ -166,8 +171,8 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
#endif
std::string os_info;
- base::StringAppendF(&os_info, "%s%s", kUserAgentPlatform,
- webkit_glue::BuildOSCpuInfo().c_str());
+ base::StringAppendF(
+ &os_info, "%s%s", kUserAgentPlatform, BuildOSCpuInfo().c_str());
return BuildUserAgentFromOSAndProduct(os_info, product);
}
@@ -189,4 +194,4 @@ std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
return user_agent;
}
-} // namespace webkit_glue
+} // namespace content
« no previous file with comments | « content/child/npapi/plugin_host.cc ('k') | content/common/user_agent_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698