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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/sys_info.h" | 15 #include "base/sys_info.h" |
16 #include "base/time.h" | 16 #include "base/time.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "cc/switches.h" | 18 #include "cc/switches.h" |
| 19 #include "cc/util.h" |
19 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 20 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
20 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 21 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
21 #include "content/browser/child_process_security_policy_impl.h" | 22 #include "content/browser/child_process_security_policy_impl.h" |
22 #include "content/browser/devtools/devtools_manager_impl.h" | 23 #include "content/browser/devtools/devtools_manager_impl.h" |
23 #include "content/browser/dom_storage/dom_storage_context_impl.h" | 24 #include "content/browser/dom_storage/dom_storage_context_impl.h" |
24 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 25 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
25 #include "content/browser/download/download_stats.h" | 26 #include "content/browser/download/download_stats.h" |
26 #include "content/browser/download/mhtml_generation_manager.h" | 27 #include "content/browser/download/mhtml_generation_manager.h" |
27 #include "content/browser/download/save_package.h" | 28 #include "content/browser/download/save_package.h" |
28 #include "content/browser/gpu/gpu_data_manager_impl.h" | 29 #include "content/browser/gpu/gpu_data_manager_impl.h" |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 | 672 |
672 prefs.gesture_tap_highlight_enabled = command_line.HasSwitch( | 673 prefs.gesture_tap_highlight_enabled = command_line.HasSwitch( |
673 switches::kEnableGestureTapHighlight); | 674 switches::kEnableGestureTapHighlight); |
674 | 675 |
675 prefs.number_of_cpu_cores = base::SysInfo::NumberOfProcessors(); | 676 prefs.number_of_cpu_cores = base::SysInfo::NumberOfProcessors(); |
676 | 677 |
677 prefs.viewport_enabled = command_line.HasSwitch(switches::kEnableViewport); | 678 prefs.viewport_enabled = command_line.HasSwitch(switches::kEnableViewport); |
678 | 679 |
679 prefs.deferred_image_decoding_enabled = | 680 prefs.deferred_image_decoding_enabled = |
680 command_line.HasSwitch(switches::kEnableDeferredImageDecoding) || | 681 command_line.HasSwitch(switches::kEnableDeferredImageDecoding) || |
681 command_line.HasSwitch(cc::switches::kEnableImplSidePainting); | 682 cc::IsImplSidePaintingEnabled(&command_line); |
682 | 683 |
683 GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs); | 684 GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs); |
684 | 685 |
685 // Disable compositing in guests until we have compositing path implemented | 686 // Disable compositing in guests until we have compositing path implemented |
686 // for guests. | 687 // for guests. |
687 bool guest_compositing_enabled = command_line.HasSwitch( | 688 bool guest_compositing_enabled = command_line.HasSwitch( |
688 switches::kEnableBrowserPluginCompositing); | 689 switches::kEnableBrowserPluginCompositing); |
689 if (rvh->GetProcess()->IsGuest() && !guest_compositing_enabled) { | 690 if (rvh->GetProcess()->IsGuest() && !guest_compositing_enabled) { |
690 prefs.force_compositing_mode = false; | 691 prefs.force_compositing_mode = false; |
691 prefs.accelerated_compositing_enabled = false; | 692 prefs.accelerated_compositing_enabled = false; |
(...skipping 2760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3452 | 3453 |
3453 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3454 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3454 return browser_plugin_guest_.get(); | 3455 return browser_plugin_guest_.get(); |
3455 } | 3456 } |
3456 | 3457 |
3457 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3458 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3458 return browser_plugin_embedder_.get(); | 3459 return browser_plugin_embedder_.get(); |
3459 } | 3460 } |
3460 | 3461 |
3461 } // namespace content | 3462 } // namespace content |
OLD | NEW |