| OLD | NEW |
| 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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 #include "base/debug/leak_annotations.h" | 261 #include "base/debug/leak_annotations.h" |
| 262 #include "components/crash/content/app/breakpad_linux.h" | 262 #include "components/crash/content/app/breakpad_linux.h" |
| 263 #include "components/crash/content/browser/crash_handler_host_linux.h" | 263 #include "components/crash/content/browser/crash_handler_host_linux.h" |
| 264 #endif | 264 #endif |
| 265 | 265 |
| 266 #if defined(OS_ANDROID) | 266 #if defined(OS_ANDROID) |
| 267 #include "chrome/browser/android/chrome_context_util.h" | 267 #include "chrome/browser/android/chrome_context_util.h" |
| 268 #include "chrome/browser/android/devtools_manager_delegate_android.h" | 268 #include "chrome/browser/android/devtools_manager_delegate_android.h" |
| 269 #include "chrome/browser/android/ntp/new_tab_page_url_handler.h" | 269 #include "chrome/browser/android/ntp/new_tab_page_url_handler.h" |
| 270 #include "chrome/browser/android/service_tab_launcher.h" | 270 #include "chrome/browser/android/service_tab_launcher.h" |
| 271 #include "chrome/browser/android/tab_android.h" |
| 271 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 272 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
| 272 #include "components/payments/payment_request.mojom.h" | 273 #include "components/payments/payment_request.mojom.h" |
| 273 #include "content/public/browser/android/java_interfaces.h" | 274 #include "content/public/browser/android/java_interfaces.h" |
| 274 #include "ui/base/ui_base_paths.h" | 275 #include "ui/base/ui_base_paths.h" |
| 275 #else | 276 #else |
| 276 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" | 277 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" |
| 277 #endif | 278 #endif |
| 278 | 279 |
| 279 #if defined(TOOLKIT_VIEWS) | 280 #if defined(TOOLKIT_VIEWS) |
| 280 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" | 281 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" |
| (...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2574 | 2575 |
| 2575 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2576 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2576 switches::kEnablePotentiallyAnnoyingSecurityFeatures)) { | 2577 switches::kEnablePotentiallyAnnoyingSecurityFeatures)) { |
| 2577 web_prefs->disable_reading_from_canvas = true; | 2578 web_prefs->disable_reading_from_canvas = true; |
| 2578 web_prefs->strict_mixed_content_checking = true; | 2579 web_prefs->strict_mixed_content_checking = true; |
| 2579 web_prefs->strict_powerful_feature_restrictions = true; | 2580 web_prefs->strict_powerful_feature_restrictions = true; |
| 2580 } | 2581 } |
| 2581 | 2582 |
| 2582 web_prefs->data_saver_enabled = GetDataSaverEnabledPref(prefs); | 2583 web_prefs->data_saver_enabled = GetDataSaverEnabledPref(prefs); |
| 2583 | 2584 |
| 2585 #if defined(OS_ANDROID) |
| 2586 content::WebContents* contents = |
| 2587 content::WebContents::FromRenderViewHost(rvh); |
| 2588 if (contents) { |
| 2589 TabAndroid* tab_android = TabAndroid::FromWebContents(contents); |
| 2590 if (tab_android) { |
| 2591 web_prefs->media_playback_gesture_whitelist_scope = |
| 2592 tab_android->GetWebappManifestScope(); |
| 2593 } |
| 2594 } |
| 2595 #endif // defined(OS_ANDROID) |
| 2596 |
| 2584 for (size_t i = 0; i < extra_parts_.size(); ++i) | 2597 for (size_t i = 0; i < extra_parts_.size(); ++i) |
| 2585 extra_parts_[i]->OverrideWebkitPrefs(rvh, web_prefs); | 2598 extra_parts_[i]->OverrideWebkitPrefs(rvh, web_prefs); |
| 2586 } | 2599 } |
| 2587 | 2600 |
| 2588 void ChromeContentBrowserClient::BrowserURLHandlerCreated( | 2601 void ChromeContentBrowserClient::BrowserURLHandlerCreated( |
| 2589 BrowserURLHandler* handler) { | 2602 BrowserURLHandler* handler) { |
| 2590 for (size_t i = 0; i < extra_parts_.size(); ++i) | 2603 for (size_t i = 0; i < extra_parts_.size(); ++i) |
| 2591 extra_parts_[i]->BrowserURLHandlerCreated(handler); | 2604 extra_parts_[i]->BrowserURLHandlerCreated(handler); |
| 2592 | 2605 |
| 2593 // about: handler. Must come before chrome: handler, since it will | 2606 // about: handler. Must come before chrome: handler, since it will |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3434 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3447 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3435 return variations::GetVariationParamValue( | 3448 return variations::GetVariationParamValue( |
| 3436 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3449 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3437 } | 3450 } |
| 3438 | 3451 |
| 3439 // static | 3452 // static |
| 3440 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3453 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3441 const storage::QuotaSettings* settings) { | 3454 const storage::QuotaSettings* settings) { |
| 3442 g_default_quota_settings = settings; | 3455 g_default_quota_settings = settings; |
| 3443 } | 3456 } |
| OLD | NEW |