diff options
-rw-r--r-- | content/content_common.gypi | 1 | ||||
-rw-r--r-- | ios/ios.gyp | 3 | ||||
-rw-r--r-- | ios/provider/ios_provider_web.gyp (renamed from ios/ios_web.gyp) | 10 | ||||
-rw-r--r-- | ios/web/ios_web.gyp | 25 | ||||
-rw-r--r-- | ios/web/public/user_agent.h | 19 | ||||
-rw-r--r-- | ios/web/public/user_agent.mm (renamed from content/common/user_agent_ios.mm) | 12 |
6 files changed, 57 insertions, 13 deletions
diff --git a/content/content_common.gypi b/content/content_common.gypi index a2ef395..e45d85c 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -472,7 +472,6 @@ 'common/url_schemes.cc', 'common/url_schemes.h', 'common/user_agent.cc', - 'common/user_agent_ios.mm', 'common/utility_messages.h', 'common/view_message_enums.h', 'common/view_messages.h', diff --git a/ios/ios.gyp b/ios/ios.gyp index 4545b46..81bda61 100644 --- a/ios/ios.gyp +++ b/ios/ios.gyp @@ -11,8 +11,9 @@ 'type': 'none', 'dependencies': [ 'ios_base.gyp:*', - 'ios_web.gyp:*', 'ios_tests_unit.gyp:*', + 'provider/ios_provider_web.gyp:*', + 'web/ios_web.gyp:*', ], }, ], diff --git a/ios/ios_web.gyp b/ios/provider/ios_provider_web.gyp index 6f3f2d4..df72fb7 100644 --- a/ios/ios_web.gyp +++ b/ios/provider/ios_provider_web.gyp @@ -1,4 +1,4 @@ -# Copyright 2013 The Chromium Authors. All rights reserved. +# Copyright 2014 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. { @@ -10,14 +10,14 @@ 'target_name': 'ios_provider_web', 'type': 'none', 'include_dirs': [ - '..', + '../..', ], 'sources': [ - 'public/provider/web/web_state.h', - 'public/provider/web/web_state_user_data.h', + '../public/provider/web/web_state.h', + '../public/provider/web/web_state_user_data.h', ], 'dependencies': [ - 'ios_base.gyp:ios_consumer_base', + '../ios_base.gyp:ios_consumer_base', ], }, ], diff --git a/ios/web/ios_web.gyp b/ios/web/ios_web.gyp new file mode 100644 index 0000000..df20bcc --- /dev/null +++ b/ios/web/ios_web.gyp @@ -0,0 +1,25 @@ +# Copyright 2014 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. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'targets': [ + { + 'target_name': 'ios_web', + 'type': 'static_library', + 'include_dirs': [ + '../..', + ], + 'dependencies': [ + '../../base/base.gyp:base', + ], + 'sources': [ + 'public/user_agent.h', + 'public/user_agent.mm', + ], + }, + ], +} diff --git a/ios/web/public/user_agent.h b/ios/web/public/user_agent.h new file mode 100644 index 0000000..6b1f2fc --- /dev/null +++ b/ios/web/public/user_agent.h @@ -0,0 +1,19 @@ +// Copyright 2014 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. + +#ifndef IOS_WEB_PUBLIC_USER_AGENT_H_ +#define IOS_WEB_PUBLIC_USER_AGENT_H_ + +#include <string> + +namespace web { + +// Returns the user agent to use for the given product name. +// The returned user agent is very similar to that used by Mobile Safari, for +// web page compatibility. +std::string BuildUserAgentFromProduct(const std::string& product); + +} // namespace web + +#endif // IOS_WEB_PUBLIC_USER_AGENT_H_ diff --git a/content/common/user_agent_ios.mm b/ios/web/public/user_agent.mm index ca897c1..879667e 100644 --- a/content/common/user_agent_ios.mm +++ b/ios/web/public/user_agent.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/public/common/user_agent.h" +#include "ios/web/public/user_agent.h" #import <UIKit/UIKit.h> @@ -58,10 +58,6 @@ const UAVersions& GetUAVersionsForCurrentOS() { return version_map[arraysize(version_map) - 1].ua_versions; } -} // namespace - -namespace content { - std::string BuildOSCpuInfo() { int32 os_major_version = 0; int32 os_minor_version = 0; @@ -102,6 +98,10 @@ std::string BuildOSCpuInfo() { return os_cpu; } +} // namespace + +namespace web { + std::string BuildUserAgentFromProduct(const std::string& product) { // Retrieve the kernel build number. int mib[2] = {CTL_KERN, KERN_OSVERSION}; @@ -127,4 +127,4 @@ std::string BuildUserAgentFromProduct(const std::string& product) { return user_agent; } -} // namespace content +} // namespace web |