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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 13375017: Move the ViewType enum to extensions\common. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 | Annotate | Revision Log
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 "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 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = chrome::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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698