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

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

Issue 1011953003: Refactor Permissions related method out of ContentBrowserClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission_type_enum_class
Patch Set: fix cros Created 5 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 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_browser_context.h" 5 #include "android_webview/browser/aw_browser_context.h"
6 6
7 #include "android_webview/browser/aw_form_database_service.h" 7 #include "android_webview/browser/aw_form_database_service.h"
8 #include "android_webview/browser/aw_permission_manager.h"
8 #include "android_webview/browser/aw_pref_store.h" 9 #include "android_webview/browser/aw_pref_store.h"
9 #include "android_webview/browser/aw_quota_manager_bridge.h" 10 #include "android_webview/browser/aw_quota_manager_bridge.h"
10 #include "android_webview/browser/aw_resource_context.h" 11 #include "android_webview/browser/aw_resource_context.h"
11 #include "android_webview/browser/jni_dependency_factory.h" 12 #include "android_webview/browser/jni_dependency_factory.h"
12 #include "android_webview/browser/net/aw_url_request_context_getter.h" 13 #include "android_webview/browser/net/aw_url_request_context_getter.h"
13 #include "android_webview/browser/net/init_native_callback.h" 14 #include "android_webview/browser/net/init_native_callback.h"
14 #include "base/base_paths_android.h" 15 #include "base/base_paths_android.h"
15 #include "base/bind.h" 16 #include "base/bind.h"
16 #include "base/path_service.h" 17 #include "base/path_service.h"
17 #include "base/prefs/pref_registry_simple.h" 18 #include "base/prefs/pref_registry_simple.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 return NULL; 345 return NULL;
345 } 346 }
346 347
347 content::SSLHostStateDelegate* AwBrowserContext::GetSSLHostStateDelegate() { 348 content::SSLHostStateDelegate* AwBrowserContext::GetSSLHostStateDelegate() {
348 if (!ssl_host_state_delegate_.get()) { 349 if (!ssl_host_state_delegate_.get()) {
349 ssl_host_state_delegate_.reset(new AwSSLHostStateDelegate()); 350 ssl_host_state_delegate_.reset(new AwSSLHostStateDelegate());
350 } 351 }
351 return ssl_host_state_delegate_.get(); 352 return ssl_host_state_delegate_.get();
352 } 353 }
353 354
355 content::PermissionManager* AwBrowserContext::GetPermissionManager() {
356 if (!permission_manager_.get())
357 permission_manager_.reset(new AwPermissionManager());
358 return permission_manager_.get();
359 }
360
354 void AwBrowserContext::RebuildTable( 361 void AwBrowserContext::RebuildTable(
355 const scoped_refptr<URLEnumerator>& enumerator) { 362 const scoped_refptr<URLEnumerator>& enumerator) {
356 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client 363 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client
357 // can change in the lifetime of this WebView and may not yet be set here. 364 // can change in the lifetime of this WebView and may not yet be set here.
358 // Therefore this initialization path is not used. 365 // Therefore this initialization path is not used.
359 enumerator->OnComplete(true); 366 enumerator->OnComplete(true);
360 } 367 }
361 368
362 void AwBrowserContext::CreateDataReductionProxyStatisticsIfNecessary() { 369 void AwBrowserContext::CreateDataReductionProxyStatisticsIfNecessary() {
363 DCHECK(user_pref_service_.get()); 370 DCHECK(user_pref_service_.get());
364 DCHECK(GetDataReductionProxySettings()); 371 DCHECK(GetDataReductionProxySettings());
365 data_reduction_proxy::DataReductionProxyService* 372 data_reduction_proxy::DataReductionProxyService*
366 data_reduction_proxy_service = 373 data_reduction_proxy_service =
367 GetDataReductionProxySettings()->data_reduction_proxy_service(); 374 GetDataReductionProxySettings()->data_reduction_proxy_service();
368 DCHECK(data_reduction_proxy_service); 375 DCHECK(data_reduction_proxy_service);
369 if (data_reduction_proxy_service->statistics_prefs()) 376 if (data_reduction_proxy_service->statistics_prefs())
370 return; 377 return;
371 // We don't care about commit_delay for now. It is just a dummy value. 378 // We don't care about commit_delay for now. It is just a dummy value.
372 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); 379 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60);
373 data_reduction_proxy_service->EnableCompressionStatisticsLogging( 380 data_reduction_proxy_service->EnableCompressionStatisticsLogging(
374 user_pref_service_.get(), 381 user_pref_service_.get(),
375 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 382 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
376 commit_delay); 383 commit_delay);
377 } 384 }
378 385
379 } // namespace android_webview 386 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_browser_context.h ('k') | android_webview/browser/aw_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698