Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 void AwContentClient::SetActiveURL(const GURL& url) { | |
| 15 // TODO(boliu): Implement. This method is used set the url that is used in | |
| 16 // crash reporting in case this process crashes. | |
| 17 } | |
| 18 | |
| 19 void AwContentClient::SetGpuInfo(const content::GPUInfo& gpu_info) { | |
| 20 // No-op. Android WebView does not have gpu process. | |
| 21 } | |
| 22 | |
|
joth
2012/10/09 02:00:47
on the general point - it's by design that the con
boliu
2012/10/09 18:01:47
Removes all no-op or default behavior methods from
| |
| 23 void AwContentClient::AddPepperPlugins( | |
| 24 std::vector<content::PepperPluginInfo>* plugins) { | |
| 25 // No-op. Android Webview does not support plugins. | |
| 26 } | |
| 27 | |
| 28 void AwContentClient::AddNPAPIPlugins( | |
| 29 webkit::npapi::PluginList* plugin_list) { | |
| 30 // No-op. Android Webview does not support plugins. | |
| 31 } | |
| 32 | |
| 33 void AwContentClient::AddAdditionalSchemes( | |
| 34 std::vector<std::string>* standard_schemes, | |
| 35 std::vector<std::string>* savable_schemes) { | |
| 36 // TODO(boliu): Implement. Maybe register things like content:// and app | |
| 37 // asset files here? | |
|
joth
2012/10/09 02:00:47
assets etc, get bundled under the file: scheme so
mnaganov (inactive)
2012/10/09 08:57:20
I agree, I don't see any clear benefit of having c
boliu
2012/10/09 18:01:47
No-op, so removing.
| |
| 38 } | |
| 39 | |
| 40 bool AwContentClient::HasWebUIScheme(const GURL& url) const { | |
| 41 // Android WebView does not use WebUIs. | |
| 42 return false; | |
| 43 } | |
| 44 | |
| 45 bool AwContentClient::CanHandleWhileSwappedOut(const IPC::Message& message) { | |
| 46 // Android WebView is single process, so there is no swapped out renderer. | |
| 47 return false; | |
|
joth
2012/10/09 02:00:47
for thoroughness, we make an effort to implement t
boliu
2012/10/09 18:01:47
So this is only for embedder (ie aw) messages, and
| |
| 48 } | |
| 49 | |
| 50 std::string AwContentClient::GetProduct() const { | |
| 51 // Product part of user agent. | |
| 52 // TODO(boliu): Should we return a ChromeWebView/<version> or similar? | |
|
boliu
2012/10/08 22:43:43
This is not breaking any tests because webview use
joth
2012/10/09 02:00:47
certainly not ChromeWebiew - see b/6381306 for lo
mnaganov (inactive)
2012/10/09 08:57:20
In our implementation, we always supply user agent
boliu
2012/10/09 18:01:47
I see Version/4.0 is hardcoded in ContentSettings:
mnaganov (inactive)
2012/10/10 08:51:45
Looks fine, thanks!
| |
| 53 return std::string(); | |
| 54 } | |
| 55 | |
| 56 std::string AwContentClient::GetUserAgent() const { | |
| 57 return webkit_glue::BuildUserAgentFromProduct(GetProduct()); | |
| 58 } | |
| 59 | |
| 60 string16 AwContentClient::GetLocalizedString(int message_id) const { | |
| 61 // TODO(boliu): Used only by WebKit, so only bundle those resources for | |
| 62 // Android WebView. | |
| 63 return l10n_util::GetStringUTF16(message_id); | |
| 64 } | |
| 65 | |
| 66 base::StringPiece AwContentClient::GetDataResource( | |
| 67 int resource_id, | |
| 68 ui::ScaleFactor scale_factor) const { | |
| 69 // TODO(boliu): Used only by WebKit, so only bundle those resources for | |
| 70 // Android WebView. | |
| 71 return ResourceBundle::GetSharedInstance().GetRawDataResource( | |
| 72 resource_id, scale_factor); | |
| 73 } | |
| 74 | |
| 75 } // namespace android_webview | |
| 76 | |
| OLD | NEW |