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

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

Issue 2183703005: Renderers should obtain browser InterfaceProvider by connecting to browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 // static 162 // static
163 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() { 163 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() {
164 return AwBrowserContext::GetDefault(); 164 return AwBrowserContext::GetDefault();
165 } 165 }
166 166
167 AwContentBrowserClient::AwContentBrowserClient( 167 AwContentBrowserClient::AwContentBrowserClient(
168 JniDependencyFactory* native_factory) 168 JniDependencyFactory* native_factory)
169 : native_factory_(native_factory) { 169 : native_factory_(native_factory) {
170 base::FilePath user_data_dir;
171 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) {
172 NOTREACHED() << "Failed to get app data directory for Android WebView";
173 }
174 browser_context_.reset(
175 new AwBrowserContext(user_data_dir, native_factory_));
176 g_locale_manager = native_factory->CreateAwLocaleManager(); 170 g_locale_manager = native_factory->CreateAwLocaleManager();
177 } 171 }
178 172
179 AwContentBrowserClient::~AwContentBrowserClient() { 173 AwContentBrowserClient::~AwContentBrowserClient() {
180 delete g_locale_manager; 174 delete g_locale_manager;
181 g_locale_manager = NULL; 175 g_locale_manager = NULL;
182 } 176 }
183 177
178 AwBrowserContext* AwContentBrowserClient::InitBrowserContext() {
179 base::FilePath user_data_dir;
180 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) {
181 NOTREACHED() << "Failed to get app data directory for Android WebView";
182 }
183 browser_context_.reset(
184 new AwBrowserContext(user_data_dir, native_factory_));
185 return browser_context_.get();
186 }
187
184 void AwContentBrowserClient::AddCertificate(net::CertificateMimeType cert_type, 188 void AwContentBrowserClient::AddCertificate(net::CertificateMimeType cert_type,
185 const void* cert_data, 189 const void* cert_data,
186 size_t cert_size, 190 size_t cert_size,
187 int render_process_id, 191 int render_process_id,
188 int render_frame_id) { 192 int render_frame_id) {
189 if (cert_size > 0) 193 if (cert_size > 0)
190 net::android::StoreCertificate(cert_type, cert_data, cert_size); 194 net::android::StoreCertificate(cert_type, cert_data, cert_size);
191 } 195 }
192 196
193 content::BrowserMainParts* AwContentBrowserClient::CreateBrowserMainParts( 197 content::BrowserMainParts* AwContentBrowserClient::CreateBrowserMainParts(
194 const content::MainFunctionParams& parameters) { 198 const content::MainFunctionParams& parameters) {
195 return new AwBrowserMainParts(browser_context_.get()); 199 return new AwBrowserMainParts(this);
196 } 200 }
197 201
198 content::WebContentsViewDelegate* 202 content::WebContentsViewDelegate*
199 AwContentBrowserClient::GetWebContentsViewDelegate( 203 AwContentBrowserClient::GetWebContentsViewDelegate(
200 content::WebContents* web_contents) { 204 content::WebContents* web_contents) {
201 return native_factory_->CreateViewDelegate(web_contents); 205 return native_factory_->CreateViewDelegate(web_contents);
202 } 206 }
203 207
204 void AwContentBrowserClient::RenderProcessWillLaunch( 208 void AwContentBrowserClient::RenderProcessWillLaunch(
205 content::RenderProcessHost* host) { 209 content::RenderProcessHost* host) {
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 511
508 #if defined(VIDEO_HOLE) 512 #if defined(VIDEO_HOLE)
509 content::ExternalVideoSurfaceContainer* 513 content::ExternalVideoSurfaceContainer*
510 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( 514 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(
511 content::WebContents* web_contents) { 515 content::WebContents* web_contents) {
512 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); 516 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents);
513 } 517 }
514 #endif 518 #endif
515 519
516 } // namespace android_webview 520 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_content_browser_client.h ('k') | blimp/engine/app/blimp_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698