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

Side by Side Diff: android_webview/browser/aw_content_browser_client.cc

Issue 2888173003: [WebView] Remove jni_dependency_factory.h (Closed)
Patch Set: add explicit Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/aw_content_browser_client.h" 5 #include "android_webview/browser/aw_content_browser_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
11 #include "android_webview/browser/aw_contents.h" 11 #include "android_webview/browser/aw_contents.h"
12 #include "android_webview/browser/aw_contents_client_bridge.h" 12 #include "android_webview/browser/aw_contents_client_bridge.h"
13 #include "android_webview/browser/aw_contents_io_thread_client.h" 13 #include "android_webview/browser/aw_contents_io_thread_client.h"
14 #include "android_webview/browser/aw_cookie_access_policy.h" 14 #include "android_webview/browser/aw_cookie_access_policy.h"
15 #include "android_webview/browser/aw_devtools_manager_delegate.h" 15 #include "android_webview/browser/aw_devtools_manager_delegate.h"
16 #include "android_webview/browser/aw_printing_message_filter.h" 16 #include "android_webview/browser/aw_printing_message_filter.h"
17 #include "android_webview/browser/aw_quota_permission_context.h" 17 #include "android_webview/browser/aw_quota_permission_context.h"
18 #include "android_webview/browser/aw_settings.h" 18 #include "android_webview/browser/aw_settings.h"
19 #include "android_webview/browser/jni_dependency_factory.h" 19 #include "android_webview/browser/aw_web_contents_view_delegate.h"
20 #include "android_webview/browser/net/aw_url_request_context_getter.h" 20 #include "android_webview/browser/net/aw_url_request_context_getter.h"
21 #include "android_webview/browser/net_disk_cache_remover.h" 21 #include "android_webview/browser/net_disk_cache_remover.h"
22 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" 22 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h"
23 #include "android_webview/browser/tracing/aw_tracing_delegate.h" 23 #include "android_webview/browser/tracing/aw_tracing_delegate.h"
24 #include "android_webview/common/aw_descriptors.h" 24 #include "android_webview/common/aw_descriptors.h"
25 #include "android_webview/common/aw_switches.h" 25 #include "android_webview/common/aw_switches.h"
26 #include "android_webview/common/crash_reporter/aw_microdump_crash_reporter.h" 26 #include "android_webview/common/crash_reporter/aw_microdump_crash_reporter.h"
27 #include "android_webview/common/render_view_messages.h" 27 #include "android_webview/common/render_view_messages.h"
28 #include "android_webview/common/url_constants.h" 28 #include "android_webview/common/url_constants.h"
29 #include "android_webview/grit/aw_resources.h" 29 #include "android_webview/grit/aw_resources.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if (locales_string.find("en-US") == std::string::npos) 183 if (locales_string.find("en-US") == std::string::npos)
184 locales_string += ",en-US"; 184 locales_string += ",en-US";
185 return locales_string; 185 return locales_string;
186 } 186 }
187 187
188 // static 188 // static
189 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() { 189 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() {
190 return AwBrowserContext::GetDefault(); 190 return AwBrowserContext::GetDefault();
191 } 191 }
192 192
193 AwContentBrowserClient::AwContentBrowserClient( 193 AwContentBrowserClient::AwContentBrowserClient() {}
194 JniDependencyFactory* native_factory)
195 : native_factory_(native_factory) {
196 }
197 194
198 AwContentBrowserClient::~AwContentBrowserClient() {} 195 AwContentBrowserClient::~AwContentBrowserClient() {}
199 196
200 AwBrowserContext* AwContentBrowserClient::InitBrowserContext() { 197 AwBrowserContext* AwContentBrowserClient::InitBrowserContext() {
201 base::FilePath user_data_dir; 198 base::FilePath user_data_dir;
202 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) { 199 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) {
203 NOTREACHED() << "Failed to get app data directory for Android WebView"; 200 NOTREACHED() << "Failed to get app data directory for Android WebView";
204 } 201 }
205 browser_context_.reset( 202 browser_context_.reset(new AwBrowserContext(user_data_dir));
206 new AwBrowserContext(user_data_dir, native_factory_));
207 return browser_context_.get(); 203 return browser_context_.get();
208 } 204 }
209 205
210 content::BrowserMainParts* AwContentBrowserClient::CreateBrowserMainParts( 206 content::BrowserMainParts* AwContentBrowserClient::CreateBrowserMainParts(
211 const content::MainFunctionParams& parameters) { 207 const content::MainFunctionParams& parameters) {
212 return new AwBrowserMainParts(this); 208 return new AwBrowserMainParts(this);
213 } 209 }
214 210
215 content::WebContentsViewDelegate* 211 content::WebContentsViewDelegate*
216 AwContentBrowserClient::GetWebContentsViewDelegate( 212 AwContentBrowserClient::GetWebContentsViewDelegate(
217 content::WebContents* web_contents) { 213 content::WebContents* web_contents) {
218 return native_factory_->CreateViewDelegate(web_contents); 214 return AwWebContentsViewDelegate::Create(web_contents);
219 } 215 }
220 216
221 void AwContentBrowserClient::RenderProcessWillLaunch( 217 void AwContentBrowserClient::RenderProcessWillLaunch(
222 content::RenderProcessHost* host) { 218 content::RenderProcessHost* host) {
223 // Grant content: scheme access to the whole renderer process, since we impose 219 // Grant content: scheme access to the whole renderer process, since we impose
224 // per-view access checks, and access is granted by default (see 220 // per-view access checks, and access is granted by default (see
225 // AwSettings.mAllowContentUrlAccess). 221 // AwSettings.mAllowContentUrlAccess).
226 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 222 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
227 host->GetID(), url::kContentScheme); 223 host->GetID(), url::kContentScheme);
228 224
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 render_frame_host)); 554 render_frame_host));
559 555
560 // Although WebView does not support password manager feature, renderer code 556 // Although WebView does not support password manager feature, renderer code
561 // could still request this interface, so we register a dummy binder which 557 // could still request this interface, so we register a dummy binder which
562 // just drops the incoming request, to avoid the 'Failed to locate a binder 558 // just drops the incoming request, to avoid the 'Failed to locate a binder
563 // for interface' error log.. 559 // for interface' error log..
564 registry->AddInterface(base::Bind(&DummyBindPasswordManagerDriver)); 560 registry->AddInterface(base::Bind(&DummyBindPasswordManagerDriver));
565 } 561 }
566 562
567 } // namespace android_webview 563 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_content_browser_client.h ('k') | android_webview/browser/aw_quota_manager_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698