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 <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" | 59 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" |
60 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" | 60 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" |
61 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" | 61 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" |
62 #include "chrome/browser/ssl/ssl_add_cert_handler.h" | 62 #include "chrome/browser/ssl/ssl_add_cert_handler.h" |
63 #include "chrome/browser/ssl/ssl_blocking_page.h" | 63 #include "chrome/browser/ssl/ssl_blocking_page.h" |
64 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" | 64 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" |
65 #include "chrome/browser/tab_contents/tab_util.h" | 65 #include "chrome/browser/tab_contents/tab_util.h" |
66 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | 66 #include "chrome/browser/ui/media_stream_infobar_delegate.h" |
67 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 67 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
68 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 68 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 69 #include "chrome/browser/view_type_utils.h" |
69 #include "chrome/browser/user_style_sheet_watcher.h" | 70 #include "chrome/browser/user_style_sheet_watcher.h" |
70 #include "chrome/browser/user_style_sheet_watcher_factory.h" | 71 #include "chrome/browser/user_style_sheet_watcher_factory.h" |
71 #include "chrome/common/child_process_logging.h" | 72 #include "chrome/common/child_process_logging.h" |
72 #include "chrome/common/chrome_constants.h" | 73 #include "chrome/common/chrome_constants.h" |
73 #include "chrome/common/chrome_switches.h" | 74 #include "chrome/common/chrome_switches.h" |
74 #include "chrome/common/extensions/extension.h" | 75 #include "chrome/common/extensions/extension.h" |
75 #include "chrome/common/extensions/extension_process_policy.h" | 76 #include "chrome/common/extensions/extension_process_policy.h" |
76 #include "chrome/common/extensions/extension_set.h" | 77 #include "chrome/common/extensions/extension_set.h" |
77 #include "chrome/common/logging_chrome.h" | 78 #include "chrome/common/logging_chrome.h" |
78 #include "chrome/common/pref_names.h" | 79 #include "chrome/common/pref_names.h" |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 // Make sure we will set the default_encoding with canonical encoding name. | 1441 // Make sure we will set the default_encoding with canonical encoding name. |
1441 web_prefs->default_encoding = | 1442 web_prefs->default_encoding = |
1442 CharacterEncoding::GetCanonicalEncodingNameByAliasName( | 1443 CharacterEncoding::GetCanonicalEncodingNameByAliasName( |
1443 web_prefs->default_encoding); | 1444 web_prefs->default_encoding); |
1444 if (web_prefs->default_encoding.empty()) { | 1445 if (web_prefs->default_encoding.empty()) { |
1445 prefs->ClearPref(prefs::kDefaultCharset); | 1446 prefs->ClearPref(prefs::kDefaultCharset); |
1446 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); | 1447 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); |
1447 } | 1448 } |
1448 DCHECK(!web_prefs->default_encoding.empty()); | 1449 DCHECK(!web_prefs->default_encoding.empty()); |
1449 | 1450 |
| 1451 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); |
| 1452 chrome::ViewType view_type = chrome::GetViewType(web_contents); |
1450 ExtensionService* service = profile->GetExtensionService(); | 1453 ExtensionService* service = profile->GetExtensionService(); |
1451 if (service) { | 1454 if (service) { |
1452 const Extension* extension = service->extensions()->GetByID( | 1455 const Extension* extension = service->extensions()->GetByID( |
1453 rvh->GetSiteInstance()->GetSite().host()); | 1456 rvh->GetSiteInstance()->GetSite().host()); |
1454 extension_webkit_preferences::SetPreferences( | 1457 extension_webkit_preferences::SetPreferences( |
1455 extension, rvh->GetDelegate()->GetRenderViewType(), web_prefs); | 1458 extension, view_type, web_prefs); |
1456 } | 1459 } |
1457 | 1460 |
1458 if (rvh->GetDelegate()->GetRenderViewType() == | 1461 if (view_type == chrome::VIEW_TYPE_NOTIFICATION) { |
1459 chrome::VIEW_TYPE_NOTIFICATION) { | |
1460 web_prefs->allow_scripts_to_close_windows = true; | 1462 web_prefs->allow_scripts_to_close_windows = true; |
1461 } else if (rvh->GetDelegate()->GetRenderViewType() == | 1463 } else if (view_type == chrome::VIEW_TYPE_BACKGROUND_CONTENTS) { |
1462 chrome::VIEW_TYPE_BACKGROUND_CONTENTS) { | |
1463 // Disable all kinds of acceleration for background pages. | 1464 // Disable all kinds of acceleration for background pages. |
1464 // See http://crbug.com/96005 and http://crbug.com/96006 | 1465 // See http://crbug.com/96005 and http://crbug.com/96006 |
1465 web_prefs->force_compositing_mode = false; | 1466 web_prefs->force_compositing_mode = false; |
1466 web_prefs->accelerated_compositing_enabled = false; | 1467 web_prefs->accelerated_compositing_enabled = false; |
1467 web_prefs->accelerated_2d_canvas_enabled = false; | 1468 web_prefs->accelerated_2d_canvas_enabled = false; |
1468 web_prefs->accelerated_video_enabled = false; | 1469 web_prefs->accelerated_video_enabled = false; |
1469 web_prefs->accelerated_painting_enabled = false; | 1470 web_prefs->accelerated_painting_enabled = false; |
1470 web_prefs->accelerated_plugins_enabled = false; | 1471 web_prefs->accelerated_plugins_enabled = false; |
1471 } | 1472 } |
1472 | 1473 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 #if defined(USE_NSS) | 1628 #if defined(USE_NSS) |
1628 crypto::CryptoModuleBlockingPasswordDelegate* | 1629 crypto::CryptoModuleBlockingPasswordDelegate* |
1629 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1630 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1630 const GURL& url) { | 1631 const GURL& url) { |
1631 return browser::NewCryptoModuleBlockingDialogDelegate( | 1632 return browser::NewCryptoModuleBlockingDialogDelegate( |
1632 browser::kCryptoModulePasswordKeygen, url.host()); | 1633 browser::kCryptoModulePasswordKeygen, url.host()); |
1633 } | 1634 } |
1634 #endif | 1635 #endif |
1635 | 1636 |
1636 } // namespace chrome | 1637 } // namespace chrome |
OLD | NEW |