diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-16 06:09:48 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-16 06:09:48 +0000 |
commit | 1d2a72123130afa9132181d1cd1a02741b6e9eff (patch) | |
tree | 0ee4eb5fb9b4467840d6eeb26e4760ea794f120d /ash/shell.cc | |
parent | 5cef855985b4b016705c1c37542e97e1fe2eb416 (diff) | |
download | chromium_src-1d2a72123130afa9132181d1cd1a02741b6e9eff.zip chromium_src-1d2a72123130afa9132181d1cd1a02741b6e9eff.tar.gz chromium_src-1d2a72123130afa9132181d1cd1a02741b6e9eff.tar.bz2 |
Inject GPUDataManager support into ash to abstract a content dependency.
http://crbug.com/332504
R=oshima@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=245010
Review URL: https://codereview.chromium.org/138223004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell.cc')
-rw-r--r-- | ash/shell.cc | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index be56615..6845d4a 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -27,6 +27,7 @@ #include "ash/drag_drop/drag_drop_controller.h" #include "ash/first_run/first_run_helper_impl.h" #include "ash/focus_cycler.h" +#include "ash/gpu_support.h" #include "ash/high_contrast/high_contrast_controller.h" #include "ash/host/root_window_host_factory.h" #include "ash/keyboard_uma_event_filter.h" @@ -125,8 +126,6 @@ #include "base/message_loop/message_pump_x11.h" #include "base/sys_info.h" #include "chromeos/display/output_configurator.h" -#include "content/public/browser/gpu_data_manager.h" -#include "gpu/config/gpu_feature_type.h" #endif // defined(USE_X11) #include "ash/sticky_keys/sticky_keys_controller.h" #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" @@ -161,6 +160,23 @@ class AshVisibilityController : public views::corewm::VisibilityController { DISALLOW_COPY_AND_ASSIGN(AshVisibilityController); }; +class DefaultGPUSupportImpl : public GPUSupport { + public: + DefaultGPUSupportImpl() {} + virtual ~DefaultGPUSupportImpl() {} + + private: + // Overridden from GPUSupport: + virtual bool IsPanelFittingDisabled() const OVERRIDE { + return false; + } + virtual void DisableGpuWatchdog() OVERRIDE {} + virtual void GetGpuProcessHandles( + const GetGpuProcessHandlesCallback& callback) const OVERRIDE {} + + DISALLOW_COPY_AND_ASSIGN(DefaultGPUSupportImpl); +}; + } // namespace // static @@ -545,6 +561,10 @@ void Shell::DoInitialWorkspaceAnimation() { DoInitialAnimation(); } +void Shell::SetGPUSupport(scoped_ptr<GPUSupport> gpu_support) { + gpu_support_ = gpu_support.Pass(); +} + //////////////////////////////////////////////////////////////////////////////// // Shell, private: @@ -562,7 +582,8 @@ Shell::Shell(ShellDelegate* delegate) cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>( native_cursor_manager_)), simulate_modal_window_open_for_testing_(false), - is_touch_hud_projection_enabled_(false) { + is_touch_hud_projection_enabled_(false), + gpu_support_(new DefaultGPUSupportImpl) { DCHECK(delegate_.get()); display_manager_.reset(new internal::DisplayManager); @@ -572,11 +593,7 @@ Shell::Shell(ShellDelegate* delegate) gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); display_controller_.reset(new DisplayController); #if defined(OS_CHROMEOS) && defined(USE_X11) - bool is_panel_fitting_disabled = - content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( - gpu::GPU_FEATURE_TYPE_PANEL_FITTING); - - output_configurator_->Init(!is_panel_fitting_disabled); + output_configurator_->Init(!gpu_support_->IsPanelFittingDisabled()); user_metrics_recorder_.reset(new UserMetricsRecorder); base::MessagePumpX11::Current()->AddDispatcherForRootWindow( |