| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "chrome/browser/ssl/ssl_blocking_page.h" | 72 #include "chrome/browser/ssl/ssl_blocking_page.h" |
| 73 #include "chrome/browser/ssl/ssl_tab_helper.h" | 73 #include "chrome/browser/ssl/ssl_tab_helper.h" |
| 74 #include "chrome/browser/tab_contents/tab_util.h" | 74 #include "chrome/browser/tab_contents/tab_util.h" |
| 75 #include "chrome/browser/toolkit_extra_parts.h" | 75 #include "chrome/browser/toolkit_extra_parts.h" |
| 76 #include "chrome/browser/ui/chrome_select_file_policy.h" | 76 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 77 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 77 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
| 78 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 78 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 79 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" | 79 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
| 80 #include "chrome/browser/user_style_sheet_watcher.h" | 80 #include "chrome/browser/user_style_sheet_watcher.h" |
| 81 #include "chrome/browser/user_style_sheet_watcher_factory.h" | 81 #include "chrome/browser/user_style_sheet_watcher_factory.h" |
| 82 #include "chrome/browser/view_type_utils.h" | |
| 83 #include "chrome/common/child_process_logging.h" | 82 #include "chrome/common/child_process_logging.h" |
| 84 #include "chrome/common/chrome_constants.h" | 83 #include "chrome/common/chrome_constants.h" |
| 85 #include "chrome/common/chrome_paths.h" | 84 #include "chrome/common/chrome_paths.h" |
| 86 #include "chrome/common/chrome_process_type.h" | 85 #include "chrome/common/chrome_process_type.h" |
| 87 #include "chrome/common/chrome_switches.h" | 86 #include "chrome/common/chrome_switches.h" |
| 88 #include "chrome/common/extensions/background_info.h" | 87 #include "chrome/common/extensions/background_info.h" |
| 89 #include "chrome/common/extensions/extension.h" | 88 #include "chrome/common/extensions/extension.h" |
| 90 #include "chrome/common/extensions/extension_process_policy.h" | 89 #include "chrome/common/extensions/extension_process_policy.h" |
| 91 #include "chrome/common/extensions/extension_set.h" | 90 #include "chrome/common/extensions/extension_set.h" |
| 92 #include "chrome/common/extensions/permissions/socket_permission.h" | 91 #include "chrome/common/extensions/permissions/socket_permission.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 103 #include "content/public/browser/child_process_security_policy.h" | 102 #include "content/public/browser/child_process_security_policy.h" |
| 104 #include "content/public/browser/compositor_util.h" | 103 #include "content/public/browser/compositor_util.h" |
| 105 #include "content/public/browser/render_process_host.h" | 104 #include "content/public/browser/render_process_host.h" |
| 106 #include "content/public/browser/render_view_host.h" | 105 #include "content/public/browser/render_view_host.h" |
| 107 #include "content/public/browser/resource_context.h" | 106 #include "content/public/browser/resource_context.h" |
| 108 #include "content/public/browser/site_instance.h" | 107 #include "content/public/browser/site_instance.h" |
| 109 #include "content/public/browser/web_contents.h" | 108 #include "content/public/browser/web_contents.h" |
| 110 #include "content/public/browser/web_contents_view.h" | 109 #include "content/public/browser/web_contents_view.h" |
| 111 #include "content/public/common/child_process_host.h" | 110 #include "content/public/common/child_process_host.h" |
| 112 #include "content/public/common/content_descriptors.h" | 111 #include "content/public/common/content_descriptors.h" |
| 112 #include "extensions/browser/view_type_utils.h" |
| 113 #include "extensions/common/constants.h" | 113 #include "extensions/common/constants.h" |
| 114 #include "grit/generated_resources.h" | 114 #include "grit/generated_resources.h" |
| 115 #include "grit/ui_resources.h" | 115 #include "grit/ui_resources.h" |
| 116 #include "net/base/escape.h" | 116 #include "net/base/escape.h" |
| 117 #include "net/base/mime_util.h" | 117 #include "net/base/mime_util.h" |
| 118 #include "net/cookies/canonical_cookie.h" | 118 #include "net/cookies/canonical_cookie.h" |
| 119 #include "net/cookies/cookie_options.h" | 119 #include "net/cookies/cookie_options.h" |
| 120 #include "net/ssl/ssl_cert_request_info.h" | 120 #include "net/ssl/ssl_cert_request_info.h" |
| 121 #include "ppapi/host/ppapi_host.h" | 121 #include "ppapi/host/ppapi_host.h" |
| 122 #include "ui/base/l10n/l10n_util.h" | 122 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 if (web_prefs->default_encoding.empty()) { | 1839 if (web_prefs->default_encoding.empty()) { |
| 1840 prefs->ClearPref(prefs::kDefaultCharset); | 1840 prefs->ClearPref(prefs::kDefaultCharset); |
| 1841 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); | 1841 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); |
| 1842 } | 1842 } |
| 1843 DCHECK(!web_prefs->default_encoding.empty()); | 1843 DCHECK(!web_prefs->default_encoding.empty()); |
| 1844 | 1844 |
| 1845 if (content::IsForceCompositingModeEnabled()) | 1845 if (content::IsForceCompositingModeEnabled()) |
| 1846 web_prefs->force_compositing_mode = true; | 1846 web_prefs->force_compositing_mode = true; |
| 1847 | 1847 |
| 1848 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); | 1848 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); |
| 1849 chrome::ViewType view_type = chrome::GetViewType(web_contents); | 1849 extensions::ViewType view_type = extensions::GetViewType(web_contents); |
| 1850 ExtensionService* service = | 1850 ExtensionService* service = |
| 1851 extensions::ExtensionSystem::Get(profile)->extension_service(); | 1851 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 1852 if (service) { | 1852 if (service) { |
| 1853 const GURL& url = rvh->GetSiteInstance()->GetSiteURL(); | 1853 const GURL& url = rvh->GetSiteInstance()->GetSiteURL(); |
| 1854 const Extension* extension = service->extensions()->GetByID(url.host()); | 1854 const Extension* extension = service->extensions()->GetByID(url.host()); |
| 1855 // Ensure that we are only granting extension preferences to URLs with | 1855 // Ensure that we are only granting extension preferences to URLs with |
| 1856 // the correct scheme. Without this check, chrome-guest:// schemes used by | 1856 // the correct scheme. Without this check, chrome-guest:// schemes used by |
| 1857 // webview tags as well as hosts that happen to match the id of an | 1857 // webview tags as well as hosts that happen to match the id of an |
| 1858 // installed extension would get the wrong preferences. | 1858 // installed extension would get the wrong preferences. |
| 1859 if (url.SchemeIs(extensions::kExtensionScheme)) { | 1859 if (url.SchemeIs(extensions::kExtensionScheme)) { |
| 1860 extension_webkit_preferences::SetPreferences( | 1860 extension_webkit_preferences::SetPreferences( |
| 1861 extension, view_type, web_prefs); | 1861 extension, view_type, web_prefs); |
| 1862 } | 1862 } |
| 1863 } | 1863 } |
| 1864 | 1864 |
| 1865 if (view_type == chrome::VIEW_TYPE_NOTIFICATION) { | 1865 if (view_type == extensions::VIEW_TYPE_NOTIFICATION) { |
| 1866 web_prefs->allow_scripts_to_close_windows = true; | 1866 web_prefs->allow_scripts_to_close_windows = true; |
| 1867 } else if (view_type == chrome::VIEW_TYPE_BACKGROUND_CONTENTS) { | 1867 } else if (view_type == extensions::VIEW_TYPE_BACKGROUND_CONTENTS) { |
| 1868 // Disable all kinds of acceleration for background pages. | 1868 // Disable all kinds of acceleration for background pages. |
| 1869 // See http://crbug.com/96005 and http://crbug.com/96006 | 1869 // See http://crbug.com/96005 and http://crbug.com/96006 |
| 1870 web_prefs->force_compositing_mode = false; | 1870 web_prefs->force_compositing_mode = false; |
| 1871 web_prefs->accelerated_compositing_enabled = false; | 1871 web_prefs->accelerated_compositing_enabled = false; |
| 1872 } | 1872 } |
| 1873 | 1873 |
| 1874 #if defined(FILE_MANAGER_EXTENSION) | 1874 #if defined(FILE_MANAGER_EXTENSION) |
| 1875 // Override the default of suppressing HW compositing for WebUI pages for the | 1875 // Override the default of suppressing HW compositing for WebUI pages for the |
| 1876 // file manager, which is implemented using WebUI but wants HW acceleration | 1876 // file manager, which is implemented using WebUI but wants HW acceleration |
| 1877 // for video decode & render. | 1877 // for video decode & render. |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2179 io_thread_application_locale_ = locale; | 2179 io_thread_application_locale_ = locale; |
| 2180 } | 2180 } |
| 2181 | 2181 |
| 2182 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 2182 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 2183 const std::string& locale) { | 2183 const std::string& locale) { |
| 2184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 2185 io_thread_application_locale_ = locale; | 2185 io_thread_application_locale_ = locale; |
| 2186 } | 2186 } |
| 2187 | 2187 |
| 2188 } // namespace chrome | 2188 } // namespace chrome |
| OLD | NEW |