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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « android_webview/common/aw_content_client.h ('k') | android_webview/lib/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "android_webview/common/aw_content_client.h"
6
7 #include "base/basictypes.h"
8 #include "ui/base/l10n/l10n_util.h"
9 #include "ui/base/resource/resource_bundle.h"
10 #include "webkit/user_agent/user_agent_util.h"
11
12 namespace android_webview {
13
14 std::string AwContentClient::GetProduct() const {
15 // "Version/4.0" had been hardcoded in the legacy WebView.
16 return std::string("Version/4.0");
17 }
18
19 std::string AwContentClient::GetUserAgent() const {
20 return webkit_glue::BuildUserAgentFromProduct(GetProduct());
21 }
22
23 string16 AwContentClient::GetLocalizedString(int message_id) const {
24 // TODO(boliu): Used only by WebKit, so only bundle those resources for
25 // Android WebView.
26 return l10n_util::GetStringUTF16(message_id);
27 }
28
29 base::StringPiece AwContentClient::GetDataResource(
30 int resource_id,
31 ui::ScaleFactor scale_factor) const {
32 // TODO(boliu): Used only by WebKit, so only bundle those resources for
33 // Android WebView.
34 return ResourceBundle::GetSharedInstance().GetRawDataResource(
35 resource_id, scale_factor);
36 }
37
38 } // namespace android_webview
39
OLDNEW
« 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