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

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

Issue 2884353003: [WebView] Remove more redundant classes (Closed)
Patch Set: 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"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 189
190 // static 190 // static
191 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() { 191 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() {
192 return AwBrowserContext::GetDefault(); 192 return AwBrowserContext::GetDefault();
193 } 193 }
194 194
195 AwContentBrowserClient::AwContentBrowserClient( 195 AwContentBrowserClient::AwContentBrowserClient(
196 JniDependencyFactory* native_factory) 196 JniDependencyFactory* native_factory)
197 : native_factory_(native_factory) { 197 : native_factory_(native_factory) {
198 g_locale_manager = native_factory->CreateAwLocaleManager(); 198 g_locale_manager = new AwLocaleManager();
199 } 199 }
200 200
201 AwContentBrowserClient::~AwContentBrowserClient() { 201 AwContentBrowserClient::~AwContentBrowserClient() {
202 delete g_locale_manager; 202 delete g_locale_manager;
203 g_locale_manager = NULL; 203 g_locale_manager = NULL;
204 } 204 }
205 205
206 AwBrowserContext* AwContentBrowserClient::InitBrowserContext() { 206 AwBrowserContext* AwContentBrowserClient::InitBrowserContext() {
207 base::FilePath user_data_dir; 207 base::FilePath user_data_dir;
208 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) { 208 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) {
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 mappings->ShareWithRegion(kAndroidWebViewLocalePakDescriptor, fd, region); 507 mappings->ShareWithRegion(kAndroidWebViewLocalePakDescriptor, fd, region);
508 508
509 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted( 509 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted(
510 child_process_id, mappings); 510 child_process_id, mappings);
511 } 511 }
512 512
513 void AwContentBrowserClient::OverrideWebkitPrefs( 513 void AwContentBrowserClient::OverrideWebkitPrefs(
514 content::RenderViewHost* rvh, 514 content::RenderViewHost* rvh,
515 content::WebPreferences* web_prefs) { 515 content::WebPreferences* web_prefs) {
516 if (!preferences_populater_.get()) { 516 if (!preferences_populater_.get()) {
517 preferences_populater_ = 517 preferences_populater_ = base::WrapUnique(new AwWebPreferencesPopulater());
518 base::WrapUnique(native_factory_->CreateWebPreferencesPopulater());
519 } 518 }
520 preferences_populater_->PopulateFor( 519 preferences_populater_->PopulateFor(
521 content::WebContents::FromRenderViewHost(rvh), web_prefs); 520 content::WebContents::FromRenderViewHost(rvh), web_prefs);
522 } 521 }
523 522
524 std::vector<std::unique_ptr<content::NavigationThrottle>> 523 std::vector<std::unique_ptr<content::NavigationThrottle>>
525 AwContentBrowserClient::CreateThrottlesForNavigation( 524 AwContentBrowserClient::CreateThrottlesForNavigation(
526 content::NavigationHandle* navigation_handle) { 525 content::NavigationHandle* navigation_handle) {
527 std::vector<std::unique_ptr<content::NavigationThrottle>> throttles; 526 std::vector<std::unique_ptr<content::NavigationThrottle>> throttles;
528 // We allow intercepting only navigations within main frames. This 527 // We allow intercepting only navigations within main frames. This
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 render_frame_host)); 564 render_frame_host));
566 565
567 // Although WebView does not support password manager feature, renderer code 566 // Although WebView does not support password manager feature, renderer code
568 // could still request this interface, so we register a dummy binder which 567 // could still request this interface, so we register a dummy binder which
569 // just drops the incoming request, to avoid the 'Failed to locate a binder 568 // just drops the incoming request, to avoid the 'Failed to locate a binder
570 // for interface' error log.. 569 // for interface' error log..
571 registry->AddInterface(base::Bind(&DummyBindPasswordManagerDriver)); 570 registry->AddInterface(base::Bind(&DummyBindPasswordManagerDriver));
572 } 571 }
573 572
574 } // namespace android_webview 573 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698