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" |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 #endif | 590 #endif |
591 | 591 |
592 prefs.number_of_cpu_cores = base::SysInfo::NumberOfProcessors(); | 592 prefs.number_of_cpu_cores = base::SysInfo::NumberOfProcessors(); |
593 | 593 |
594 prefs.viewport_enabled = command_line.HasSwitch(switches::kEnableViewport); | 594 prefs.viewport_enabled = command_line.HasSwitch(switches::kEnableViewport); |
595 | 595 |
596 prefs.deferred_image_decoding_enabled = | 596 prefs.deferred_image_decoding_enabled = |
597 command_line.HasSwitch(switches::kEnableDeferredImageDecoding) || | 597 command_line.HasSwitch(switches::kEnableDeferredImageDecoding) || |
598 cc::switches::IsImplSidePaintingEnabled(); | 598 cc::switches::IsImplSidePaintingEnabled(); |
599 | 599 |
| 600 prefs.spatial_navigation_enabled = command_line.HasSwitch( |
| 601 switches::kEnableSpatialNavigation); |
| 602 |
600 GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs); | 603 GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs); |
601 | 604 |
602 // Disable compositing in guests until we have compositing path implemented | 605 // Disable compositing in guests until we have compositing path implemented |
603 // for guests. | 606 // for guests. |
604 bool guest_compositing_enabled = !command_line.HasSwitch( | 607 bool guest_compositing_enabled = !command_line.HasSwitch( |
605 switches::kDisableBrowserPluginCompositing); | 608 switches::kDisableBrowserPluginCompositing); |
606 if (rvh->GetProcess()->IsGuest() && !guest_compositing_enabled) { | 609 if (rvh->GetProcess()->IsGuest() && !guest_compositing_enabled) { |
607 prefs.force_compositing_mode = false; | 610 prefs.force_compositing_mode = false; |
608 prefs.accelerated_compositing_enabled = false; | 611 prefs.accelerated_compositing_enabled = false; |
609 } | 612 } |
(...skipping 2837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3447 } | 3450 } |
3448 | 3451 |
3449 BrowserPluginGuestManager* | 3452 BrowserPluginGuestManager* |
3450 WebContentsImpl::GetBrowserPluginGuestManager() const { | 3453 WebContentsImpl::GetBrowserPluginGuestManager() const { |
3451 return static_cast<BrowserPluginGuestManager*>( | 3454 return static_cast<BrowserPluginGuestManager*>( |
3452 GetBrowserContext()->GetUserData( | 3455 GetBrowserContext()->GetUserData( |
3453 browser_plugin::kBrowserPluginGuestManagerKeyName)); | 3456 browser_plugin::kBrowserPluginGuestManagerKeyName)); |
3454 } | 3457 } |
3455 | 3458 |
3456 } // namespace content | 3459 } // namespace content |
OLD | NEW |