summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ash/DEPS3
-rw-r--r--ash/accelerators/accelerator_controller.cc4
-rw-r--r--ash/ash.gyp7
-rw-r--r--ash/ash_with_content_export.h (renamed from ash/content_support/ash_with_content_export.h)6
-rw-r--r--ash/content_support/DEPS5
-rw-r--r--ash/content_support/gpu_support_impl.cc32
-rw-r--r--ash/content_support/gpu_support_impl.h29
-rw-r--r--ash/content_support/inject.cc17
-rw-r--r--ash/content_support/inject.h16
-rw-r--r--ash/gpu_support.h34
-rw-r--r--ash/keyboard_overlay/keyboard_overlay_delegate.h2
-rw-r--r--ash/keyboard_overlay/keyboard_overlay_view.h2
-rw-r--r--ash/screensaver/screensaver_view.h2
-rw-r--r--ash/shell.cc33
-rw-r--r--ash/shell.h7
-rw-r--r--ash/shell/content_client/shell_browser_main_parts.cc2
-rw-r--r--ash/system/monitor/tray_monitor.cc7
-rw-r--r--chrome/browser/ui/ash/ash_init.cc2
18 files changed, 23 insertions, 187 deletions
diff --git a/ash/DEPS b/ash/DEPS
index a178653..230a37d 100644
--- a/ash/DEPS
+++ b/ash/DEPS
@@ -13,4 +13,7 @@ include_rules = [
"+net",
"+ui",
"+win8",
+
+ # Used by shell.cc, accelerator_controller.cc, tray_monitor.h
+ "+content/public/browser/gpu_data_manager.h",
]
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index b7a51cf..c4e6691 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -18,7 +18,6 @@
#include "ash/display/display_controller.h"
#include "ash/display/display_manager.h"
#include "ash/focus_cycler.h"
-#include "ash/gpu_support.h"
#include "ash/ime_control_delegate.h"
#include "ash/magnifier/magnification_controller.h"
#include "ash/magnifier/partial_magnification_controller.h"
@@ -56,6 +55,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/metrics/user_metrics.h"
+#include "content/public/browser/gpu_data_manager.h"
#include "ui/aura/env.h"
#include "ui/aura/root_window.h"
#include "ui/base/accelerators/accelerator.h"
@@ -968,7 +968,7 @@ bool AcceleratorController::PerformAction(int action,
case TOUCH_HUD_PROJECTION_TOGGLE:
return HandleTouchHudProjectToggle();
case DISABLE_GPU_WATCHDOG:
- Shell::GetInstance()->gpu_support()->DisableGpuWatchdog();
+ content::GpuDataManager::GetInstance()->DisableGpuWatchdog();
return true;
#endif // OS_CHROMEOS
case OPEN_FEEDBACK_PAGE:
diff --git a/ash/ash.gyp b/ash/ash.gyp
index fb332ba..ecf4275 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -148,7 +148,6 @@
'first_run/first_run_helper_impl.h',
'focus_cycler.cc',
'focus_cycler.h',
- 'gpu_support.h',
'high_contrast/high_contrast_controller.cc',
'high_contrast/high_contrast_controller.h',
'host/root_window_host_factory.cc',
@@ -680,11 +679,7 @@
'ASH_WITH_CONTENT_IMPLEMENTATION',
],
'sources': [
- 'content_support/ash_with_content_export.h',
- 'content_support/inject.cc',
- 'content_support/inject.h',
- 'content_support/gpu_support_impl.cc',
- 'content_support/gpu_support_impl.h',
+ 'ash_with_content_export.h',
'screensaver/screensaver_view.cc',
'screensaver/screensaver_view.h',
'keyboard_overlay/keyboard_overlay_delegate.cc',
diff --git a/ash/content_support/ash_with_content_export.h b/ash/ash_with_content_export.h
index 155b0b3..b282e4e 100644
--- a/ash/content_support/ash_with_content_export.h
+++ b/ash/ash_with_content_export.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_CONTENT_SUPPORT_ASH_WITH_CONTENT_EXPORT_H_
-#define ASH_CONTENT_SUPPORT_ASH_WITH_CONTENT_EXPORT_H_
+#ifndef ASH_ASH_WITH_CONTENT_EXPORT_H_
+#define ASH_ASH_WITH_CONTENT_EXPORT_H_
// Defines ASH_EXPORT so that functionality implemented by the Ash module can
// be exported to consumers.
@@ -29,4 +29,4 @@
#define ASH_WITH_CONTENT_EXPORT
#endif
-#endif // ASH_CONTENT_SUPPORT_ASH_WITH_CONTENT_EXPORT_H_
+#endif // ASH_ASH_WITH_CONTENT_EXPORT_H_
diff --git a/ash/content_support/DEPS b/ash/content_support/DEPS
deleted file mode 100644
index 5ed73eb..0000000
--- a/ash/content_support/DEPS
+++ /dev/null
@@ -1,5 +0,0 @@
-include_rules = [
- # TODO(beng): It may make sense to have a broad permit of content/public
- # in this file, but I'm starting out conservative.
- "+content/public/browser/gpu_data_manager.h",
-]
diff --git a/ash/content_support/gpu_support_impl.cc b/ash/content_support/gpu_support_impl.cc
deleted file mode 100644
index d425d89..0000000
--- a/ash/content_support/gpu_support_impl.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/content_support/gpu_support_impl.h"
-
-#include "content/public/browser/gpu_data_manager.h"
-#include "gpu/config/gpu_feature_type.h"
-
-namespace ash {
-
-GPUSupportImpl::GPUSupportImpl() {
-}
-
-GPUSupportImpl::~GPUSupportImpl() {
-}
-
-bool GPUSupportImpl::IsPanelFittingDisabled() const {
- return content::GpuDataManager::GetInstance()->IsFeatureBlacklisted(
- gpu::GPU_FEATURE_TYPE_PANEL_FITTING);
-}
-
-void GPUSupportImpl::DisableGpuWatchdog() {
- content::GpuDataManager::GetInstance()->DisableGpuWatchdog();
-}
-
-void GPUSupportImpl::GetGpuProcessHandles(
- const GetGpuProcessHandlesCallback& callback) const {
- content::GpuDataManager::GetInstance()->GetGpuProcessHandles(callback);
-}
-
-} // namespace ash
diff --git a/ash/content_support/gpu_support_impl.h b/ash/content_support/gpu_support_impl.h
deleted file mode 100644
index ee82d06..0000000
--- a/ash/content_support/gpu_support_impl.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ASH_CONTENT_SUPPORT_GPU_SUPPORT_IMPL_H_
-#define ASH_CONTENT_SUPPORT_GPU_SUPPORT_IMPL_H_
-
-#include "ash/gpu_support.h"
-
-namespace ash {
-
-class GPUSupportImpl : public GPUSupport {
- public:
- GPUSupportImpl();
- virtual ~GPUSupportImpl();
-
- private:
- // Overridden from GPUSupport:
- virtual bool IsPanelFittingDisabled() const OVERRIDE;
- virtual void DisableGpuWatchdog() OVERRIDE;
- virtual void GetGpuProcessHandles(
- const GetGpuProcessHandlesCallback& callback) const OVERRIDE;
-
- DISALLOW_COPY_AND_ASSIGN(GPUSupportImpl);
-};
-
-} // namespace ash
-
-#endif // ASH_CONTENT_SUPPORT_GPU_SUPPORT_IMPL_H_
diff --git a/ash/content_support/inject.cc b/ash/content_support/inject.cc
deleted file mode 100644
index 7f37865..0000000
--- a/ash/content_support/inject.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/content_support/inject.h"
-
-#include "ash/content_support/gpu_support_impl.h"
-#include "ash/shell.h"
-
-namespace ash {
-
-void InitContentSupport() {
- scoped_ptr<GPUSupportImpl> gpu_support(new GPUSupportImpl);
- Shell::GetInstance()->SetGPUSupport(gpu_support.Pass());
-}
-
-} // namespace ash
diff --git a/ash/content_support/inject.h b/ash/content_support/inject.h
deleted file mode 100644
index b821029..0000000
--- a/ash/content_support/inject.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ASH_CONTENT_SUPPORT_INJECT_H_
-#define ASH_CONTENT_SUPPORT_INJECT_H_
-
-#include "ash/content_support/ash_with_content_export.h"
-
-namespace ash {
-
-ASH_WITH_CONTENT_EXPORT void InitContentSupport();
-
-} // namespace ash
-
-#endif // ASH_CONTENT_SUPPORT_INJECT_H_
diff --git a/ash/gpu_support.h b/ash/gpu_support.h
deleted file mode 100644
index 089f121..0000000
--- a/ash/gpu_support.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ASH_GPU_SUPPORT_H_
-#define ASH_GPU_SUPPORT_H_
-
-#include <list>
-
-#include "base/callback_forward.h"
-#include "base/process/process.h"
-
-namespace ash {
-
-// An interface to allow use of content::GpuDataManager to be injected in
-// configurations that permit a dependency on content.
-class GPUSupport {
- public:
- typedef base::Callback<void(const std::list<base::ProcessHandle>&)>
- GetGpuProcessHandlesCallback;
-
- virtual ~GPUSupport() {}
-
- virtual bool IsPanelFittingDisabled() const = 0;
-
- virtual void DisableGpuWatchdog() = 0;
-
- virtual void GetGpuProcessHandles(
- const GetGpuProcessHandlesCallback& callback) const = 0;
-};
-
-} // namespace ash
-
-#endif // ASH_GPU_SUPPORT_H_
diff --git a/ash/keyboard_overlay/keyboard_overlay_delegate.h b/ash/keyboard_overlay/keyboard_overlay_delegate.h
index 91d7ddd..3d7c22f 100644
--- a/ash/keyboard_overlay/keyboard_overlay_delegate.h
+++ b/ash/keyboard_overlay/keyboard_overlay_delegate.h
@@ -5,7 +5,7 @@
#ifndef ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_DELEGATE_H_
#define ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_DELEGATE_H_
-#include "ash/content_support/ash_with_content_export.h"
+#include "ash/ash_with_content_export.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
diff --git a/ash/keyboard_overlay/keyboard_overlay_view.h b/ash/keyboard_overlay/keyboard_overlay_view.h
index 0fc339a..c3235ca 100644
--- a/ash/keyboard_overlay/keyboard_overlay_view.h
+++ b/ash/keyboard_overlay/keyboard_overlay_view.h
@@ -7,7 +7,7 @@
#include <vector>
-#include "ash/content_support/ash_with_content_export.h"
+#include "ash/ash_with_content_export.h"
#include "ash/wm/overlay_event_filter.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
diff --git a/ash/screensaver/screensaver_view.h b/ash/screensaver/screensaver_view.h
index cb565b8..bf140fa 100644
--- a/ash/screensaver/screensaver_view.h
+++ b/ash/screensaver/screensaver_view.h
@@ -5,7 +5,7 @@
#ifndef ASH_SCREENSAVER_SCREENSAVER_VIEW_H_
#define ASH_SCREENSAVER_SCREENSAVER_VIEW_H_
-#include "ash/content_support/ash_with_content_export.h"
+#include "ash/ash_with_content_export.h"
#include "base/callback.h"
#include "content/public/browser/web_contents_observer.h"
#include "ui/views/widget/widget_delegate.h"
diff --git a/ash/shell.cc b/ash/shell.cc
index 6845d4a..be56615 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -27,7 +27,6 @@
#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"
@@ -126,6 +125,8 @@
#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"
@@ -160,23 +161,6 @@ 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
@@ -561,10 +545,6 @@ void Shell::DoInitialWorkspaceAnimation() {
DoInitialAnimation();
}
-void Shell::SetGPUSupport(scoped_ptr<GPUSupport> gpu_support) {
- gpu_support_ = gpu_support.Pass();
-}
-
////////////////////////////////////////////////////////////////////////////////
// Shell, private:
@@ -582,8 +562,7 @@ 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),
- gpu_support_(new DefaultGPUSupportImpl) {
+ is_touch_hud_projection_enabled_(false) {
DCHECK(delegate_.get());
display_manager_.reset(new internal::DisplayManager);
@@ -593,7 +572,11 @@ Shell::Shell(ShellDelegate* delegate)
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_);
display_controller_.reset(new DisplayController);
#if defined(OS_CHROMEOS) && defined(USE_X11)
- output_configurator_->Init(!gpu_support_->IsPanelFittingDisabled());
+ bool is_panel_fitting_disabled =
+ content::GpuDataManager::GetInstance()->IsFeatureBlacklisted(
+ gpu::GPU_FEATURE_TYPE_PANEL_FITTING);
+
+ output_configurator_->Init(!is_panel_fitting_disabled);
user_metrics_recorder_.reset(new UserMetricsRecorder);
base::MessagePumpX11::Current()->AddDispatcherForRootWindow(
diff --git a/ash/shell.h b/ash/shell.h
index ff58e66..a452cd5 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -83,7 +83,6 @@ class CapsLockDelegate;
class DesktopBackgroundController;
class DisplayController;
class FirstRunHelper;
-class GPUSupport;
class HighContrastController;
class LockStateController;
class MagnificationController;
@@ -536,9 +535,6 @@ class ASH_EXPORT Shell
}
#endif // defined(OS_CHROMEOS)
- GPUSupport* gpu_support() { return gpu_support_.get(); }
- void SetGPUSupport(scoped_ptr<GPUSupport> gpu_support);
-
private:
FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
@@ -711,9 +707,6 @@ class ASH_EXPORT Shell
bool is_touch_hud_projection_enabled_;
- // Injected content::GPUDataManager support.
- scoped_ptr<GPUSupport> gpu_support_;
-
DISALLOW_COPY_AND_ASSIGN(Shell);
};
diff --git a/ash/shell/content_client/shell_browser_main_parts.cc b/ash/shell/content_client/shell_browser_main_parts.cc
index 9d088b5..2e4a4c4 100644
--- a/ash/shell/content_client/shell_browser_main_parts.cc
+++ b/ash/shell/content_client/shell_browser_main_parts.cc
@@ -5,7 +5,6 @@
#include "ash/shell/content_client/shell_browser_main_parts.h"
#include "ash/ash_switches.h"
-#include "ash/content_support/inject.h"
#include "ash/desktop_background/desktop_background_controller.h"
#include "ash/shell.h"
#include "ash/shell/shell_delegate_impl.h"
@@ -124,7 +123,6 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
#endif
ash::Shell::CreateInstance(delegate_);
- ash::InitContentSupport();
delegate_->set_browser_context(browser_context_.get());
ash::Shell::GetInstance()->CreateShelf();
ash::Shell::GetInstance()->UpdateAfterLoginStatusChange(
diff --git a/ash/system/monitor/tray_monitor.cc b/ash/system/monitor/tray_monitor.cc
index e6fe59b..6719a5d0 100644
--- a/ash/system/monitor/tray_monitor.cc
+++ b/ash/system/monitor/tray_monitor.cc
@@ -4,13 +4,12 @@
#include "ash/system/monitor/tray_monitor.h"
-#include "ash/gpu_support.h"
-#include "ash/shell.h"
#include "ash/system/tray/tray_item_view.h"
#include "base/process/memory.h"
#include "base/process/process_metrics.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/public/browser/gpu_data_manager.h"
#include "ui/base/text/bytes_formatting.h"
#include "ui/views/border.h"
#include "ui/views/controls/label.h"
@@ -54,10 +53,10 @@ void TrayMonitor::DestroyTrayView() {
}
void TrayMonitor::OnTimer() {
- GPUSupport::GetGpuProcessHandlesCallback callback =
+ content::GpuDataManager::GetGpuProcessHandlesCallback callback =
base::Bind(&TrayMonitor::OnGotHandles, base::Unretained(this));
refresh_timer_.Stop();
- Shell::GetInstance()->gpu_support()->GetGpuProcessHandles(callback);
+ content::GpuDataManager::GetInstance()->GetGpuProcessHandles(callback);
}
void TrayMonitor::OnGotHandles(const std::list<base::ProcessHandle>& handles) {
diff --git a/chrome/browser/ui/ash/ash_init.cc b/chrome/browser/ui/ash/ash_init.cc
index 7d980af..f6a482f 100644
--- a/chrome/browser/ui/ash/ash_init.cc
+++ b/chrome/browser/ui/ash/ash_init.cc
@@ -6,7 +6,6 @@
#include "ash/accelerators/accelerator_controller.h"
#include "ash/ash_switches.h"
-#include "ash/content_support/inject.h"
#include "ash/high_contrast/high_contrast_controller.h"
#include "ash/magnifier/magnification_controller.h"
#include "ash/magnifier/partial_magnification_controller.h"
@@ -59,7 +58,6 @@ void OpenAsh() {
// Shell takes ownership of ChromeShellDelegate.
ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate);
- ash::InitContentSupport();
shell->event_rewriter_filter()->SetEventRewriterDelegate(
scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass());
shell->accelerator_controller()->SetScreenshotDelegate(