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

Unified Diff: android_webview/common/aw_content_client.cc

Issue 11017024: Implement AwContentsClient and remove dependency on chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Also slip in removing 'aw_' from aw_contents_client_ var name Created 8 years, 2 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 | « android_webview/common/aw_content_client.h ('k') | android_webview/lib/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/common/aw_content_client.cc
diff --git a/android_webview/common/aw_content_client.cc b/android_webview/common/aw_content_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c8823e65c667e98eb3b311d4e47732fdcac5360a
--- /dev/null
+++ b/android_webview/common/aw_content_client.cc
@@ -0,0 +1,39 @@
+// Copyright (c) 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 "android_webview/common/aw_content_client.h"
+
+#include "base/basictypes.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "webkit/user_agent/user_agent_util.h"
+
+namespace android_webview {
+
+std::string AwContentClient::GetProduct() const {
+ // "Version/4.0" had been hardcoded in the legacy WebView.
+ return std::string("Version/4.0");
+}
+
+std::string AwContentClient::GetUserAgent() const {
+ return webkit_glue::BuildUserAgentFromProduct(GetProduct());
+}
+
+string16 AwContentClient::GetLocalizedString(int message_id) const {
+ // TODO(boliu): Used only by WebKit, so only bundle those resources for
+ // Android WebView.
+ return l10n_util::GetStringUTF16(message_id);
+}
+
+base::StringPiece AwContentClient::GetDataResource(
+ int resource_id,
+ ui::ScaleFactor scale_factor) const {
+ // TODO(boliu): Used only by WebKit, so only bundle those resources for
+ // Android WebView.
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(
+ resource_id, scale_factor);
+}
+
+} // namespace android_webview
+
« no previous file with comments | « android_webview/common/aw_content_client.h ('k') | android_webview/lib/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698