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 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 AccessTokenStore* ChromeContentBrowserClient::CreateAccessTokenStore() { | 1255 AccessTokenStore* ChromeContentBrowserClient::CreateAccessTokenStore() { |
1256 return new ChromeAccessTokenStore(); | 1256 return new ChromeAccessTokenStore(); |
1257 } | 1257 } |
1258 | 1258 |
1259 bool ChromeContentBrowserClient::IsFastShutdownPossible() { | 1259 bool ChromeContentBrowserClient::IsFastShutdownPossible() { |
1260 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 1260 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
1261 return !browser_command_line.HasSwitch(switches::kChromeFrame); | 1261 return !browser_command_line.HasSwitch(switches::kChromeFrame); |
1262 } | 1262 } |
1263 | 1263 |
1264 void ChromeContentBrowserClient::OverrideWebkitPrefs( | 1264 void ChromeContentBrowserClient::OverrideWebkitPrefs( |
1265 RenderViewHost* rvh, WebPreferences* web_prefs) { | 1265 RenderViewHost* rvh, const GURL& url, WebPreferences* web_prefs) { |
1266 Profile* profile = Profile::FromBrowserContext( | 1266 Profile* profile = Profile::FromBrowserContext( |
1267 rvh->process()->GetBrowserContext()); | 1267 rvh->process()->GetBrowserContext()); |
1268 PrefService* prefs = profile->GetPrefs(); | 1268 PrefService* prefs = profile->GetPrefs(); |
1269 | 1269 |
1270 web_prefs->standard_font_family = | 1270 web_prefs->standard_font_family = |
1271 UTF8ToUTF16(prefs->GetString(prefs::kWebKitGlobalStandardFontFamily)); | 1271 UTF8ToUTF16(prefs->GetString(prefs::kWebKitGlobalStandardFontFamily)); |
1272 web_prefs->fixed_font_family = | 1272 web_prefs->fixed_font_family = |
1273 UTF8ToUTF16(prefs->GetString(prefs::kWebKitGlobalFixedFontFamily)); | 1273 UTF8ToUTF16(prefs->GetString(prefs::kWebKitGlobalFixedFontFamily)); |
1274 web_prefs->serif_font_family = | 1274 web_prefs->serif_font_family = |
1275 UTF8ToUTF16(prefs->GetString(prefs::kWebKitGlobalSerifFontFamily)); | 1275 UTF8ToUTF16(prefs->GetString(prefs::kWebKitGlobalSerifFontFamily)); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 chrome::VIEW_TYPE_BACKGROUND_CONTENTS) { | 1395 chrome::VIEW_TYPE_BACKGROUND_CONTENTS) { |
1396 // Disable all kinds of acceleration for background pages. | 1396 // Disable all kinds of acceleration for background pages. |
1397 // See http://crbug.com/96005 and http://crbug.com/96006 | 1397 // See http://crbug.com/96005 and http://crbug.com/96006 |
1398 web_prefs->force_compositing_mode = false; | 1398 web_prefs->force_compositing_mode = false; |
1399 web_prefs->accelerated_compositing_enabled = false; | 1399 web_prefs->accelerated_compositing_enabled = false; |
1400 web_prefs->accelerated_2d_canvas_enabled = false; | 1400 web_prefs->accelerated_2d_canvas_enabled = false; |
1401 web_prefs->accelerated_video_enabled = false; | 1401 web_prefs->accelerated_video_enabled = false; |
1402 web_prefs->accelerated_painting_enabled = false; | 1402 web_prefs->accelerated_painting_enabled = false; |
1403 web_prefs->accelerated_plugins_enabled = false; | 1403 web_prefs->accelerated_plugins_enabled = false; |
1404 } | 1404 } |
| 1405 |
| 1406 #if defined(FILE_MANAGER_EXTENSION) |
| 1407 // Override the default of suppressing HW compositing for WebUI pages for the |
| 1408 // file manager, which is implemented using WebUI but wants HW acceleration |
| 1409 // for video decode & render. |
| 1410 if (url.spec() == chrome::kChromeUIFileManagerURL) { |
| 1411 web_prefs->accelerated_compositing_enabled = true; |
| 1412 web_prefs->accelerated_2d_canvas_enabled = true; |
| 1413 } |
| 1414 #endif |
1405 } | 1415 } |
1406 | 1416 |
1407 void ChromeContentBrowserClient::UpdateInspectorSetting( | 1417 void ChromeContentBrowserClient::UpdateInspectorSetting( |
1408 RenderViewHost* rvh, const std::string& key, const std::string& value) { | 1418 RenderViewHost* rvh, const std::string& key, const std::string& value) { |
1409 content::BrowserContext* browser_context = | 1419 content::BrowserContext* browser_context = |
1410 rvh->process()->GetBrowserContext(); | 1420 rvh->process()->GetBrowserContext(); |
1411 DictionaryPrefUpdate update( | 1421 DictionaryPrefUpdate update( |
1412 Profile::FromBrowserContext(browser_context)->GetPrefs(), | 1422 Profile::FromBrowserContext(browser_context)->GetPrefs(), |
1413 prefs::kWebKitInspectorSettings); | 1423 prefs::kWebKitInspectorSettings); |
1414 DictionaryValue* inspector_settings = update.Get(); | 1424 DictionaryValue* inspector_settings = update.Get(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 #if defined(USE_NSS) | 1528 #if defined(USE_NSS) |
1519 crypto::CryptoModuleBlockingPasswordDelegate* | 1529 crypto::CryptoModuleBlockingPasswordDelegate* |
1520 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1530 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1521 const GURL& url) { | 1531 const GURL& url) { |
1522 return browser::NewCryptoModuleBlockingDialogDelegate( | 1532 return browser::NewCryptoModuleBlockingDialogDelegate( |
1523 browser::kCryptoModulePasswordKeygen, url.host()); | 1533 browser::kCryptoModulePasswordKeygen, url.host()); |
1524 } | 1534 } |
1525 #endif | 1535 #endif |
1526 | 1536 |
1527 } // namespace chrome | 1537 } // namespace chrome |
OLD | NEW |