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

Unified Diff: android_webview/browser/aw_content_browser_client.cc

Issue 13409003: Hide ContentClient getters from embedders so that they they don't reuse content's embedder API. The… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 8 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
Index: android_webview/browser/aw_content_browser_client.cc
===================================================================
--- android_webview/browser/aw_content_browser_client.cc (revision 192622)
+++ android_webview/browser/aw_content_browser_client.cc (working copy)
@@ -26,8 +26,11 @@
#include "net/ssl/ssl_info.h"
#include "ui/base/resource/resource_bundle.h"
+namespace android_webview {
namespace {
+AwBrowserContext* g_browser_context;
+
class AwAccessTokenStore : public content::AccessTokenStore {
public:
AwAccessTokenStore() { }
@@ -51,14 +54,22 @@
}
-namespace android_webview {
+std::string AwContentBrowserClient::GetAcceptLangsImpl() {
+ // Start with the currnet locale.
+ std::string langs = base::android::GetDefaultLocale();
-// static
-AwContentBrowserClient* AwContentBrowserClient::FromContentBrowserClient(
- content::ContentBrowserClient* client) {
- return static_cast<AwContentBrowserClient*>(client);
+ // If we're not en-US, add in en-US which will be
+ // used with a lower q-value.
+ if (StringToLowerASCII(langs) != "en-us") {
+ langs += ",en-US";
+ }
+ return langs;
}
+AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() {
+ return g_browser_context;
+}
+
AwContentBrowserClient::AwContentBrowserClient(
JniDependencyFactory* native_factory)
: native_factory_(native_factory) {
@@ -68,9 +79,11 @@
}
browser_context_.reset(
new AwBrowserContext(user_data_dir, native_factory_));
+ g_browser_context = browser_context_.get();
}
AwContentBrowserClient::~AwContentBrowserClient() {
+ g_browser_context = NULL;
}
void AwContentBrowserClient::AddCertificate(net::URLRequest* request,
@@ -83,10 +96,6 @@
net::android::StoreCertificate(cert_type, cert_data, cert_size);
}
-AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() {
- return browser_context_.get();
-}
-
content::BrowserMainParts* AwContentBrowserClient::CreateBrowserMainParts(
const content::MainFunctionParams& parameters) {
return new AwBrowserMainParts(browser_context_.get());
@@ -151,15 +160,7 @@
std::string AwContentBrowserClient::GetAcceptLangs(
content::BrowserContext* context) {
- // Start with the currnet locale.
- std::string langs = GetApplicationLocale();
-
- // If we're not en-US, add in en-US which will be
- // used with a lower q-value.
- if (StringToLowerASCII(langs) != "en-us") {
- langs += ",en-US";
- }
- return langs;
+ return GetAcceptLangsImpl();
}
gfx::ImageSkia* AwContentBrowserClient::GetDefaultFavicon() {
@@ -340,12 +341,6 @@
NOTIMPLEMENTED();
}
-void AwContentBrowserClient::ClearInspectorSettings(
- content::RenderViewHost* rvh) {
- // TODO(boliu): Implement persisting inspector settings.
- NOTIMPLEMENTED();
-}
-
void AwContentBrowserClient::ClearCache(content::RenderViewHost* rvh) {
RemoveHttpDiskCache(rvh->GetProcess()->GetBrowserContext(),
rvh->GetProcess()->GetID());
« no previous file with comments | « android_webview/browser/aw_content_browser_client.h ('k') | android_webview/browser/net/aw_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698