Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Unified Diff: apps/shell/browser/shell_desktop_controller.h

Issue 308783002: Removes the dependency to WMTestHelper from app shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment fix Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: apps/shell/browser/shell_desktop_controller.h
diff --git a/apps/shell/browser/shell_desktop_controller.h b/apps/shell/browser/shell_desktop_controller.h
index f1ba503ebfdf5fe9179f645811317fda8cf6a1d5..1d5ab0f1fabf7f2808a4508a756bb341dd570706 100644
--- a/apps/shell/browser/shell_desktop_controller.h
+++ b/apps/shell/browser/shell_desktop_controller.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "ui/aura/client/window_tree_client.h"
#include "ui/aura/window_tree_host_observer.h"
#include "ui/gfx/geometry/size.h"
@@ -17,7 +18,12 @@
namespace aura {
class TestScreen;
+class Window;
class WindowTreeHost;
+namespace client {
+class DefaultCaptureClient;
+class FocusClient;
+}
}
namespace content {
@@ -32,8 +38,9 @@ class UserActivityPowerManagerNotifier;
namespace wm {
class CursorManager;
+class CompoundEventFilter;
+class InputMethodEventFilter;
class UserActivityDetector;
-class WMTestHelper;
}
namespace apps {
@@ -41,11 +48,12 @@ namespace apps {
class ShellAppWindow;
// Handles desktop-related tasks for app_shell.
-class ShellDesktopController
+class ShellDesktopController : aura::client::WindowTreeClient
#if defined(OS_CHROMEOS)
- : public ui::DisplayConfigurator::Observer
+ ,
+ public ui::DisplayConfigurator::Observer
#endif
- {
+ {
public:
ShellDesktopController();
virtual ~ShellDesktopController();
@@ -55,6 +63,9 @@ class ShellDesktopController
// we need a singleton somewhere).
static ShellDesktopController* instance();
+ // Creates the window that hosts the app.
+ void CreateRootWindow();
+
// Creates a new app window and adds it to the desktop. The desktop maintains
// ownership of the window.
ShellAppWindow* CreateAppWindow(content::BrowserContext* context);
@@ -62,8 +73,10 @@ class ShellDesktopController
// Closes and destroys the app window.
void CloseAppWindow();
- // Returns the host for the Aura window tree.
- aura::WindowTreeHost* GetWindowTreeHost();
+ // Overridden from aura::client::WindowTreeClient:
+ virtual aura::Window* GetDefaultParent(aura::Window* context,
+ aura::Window* window,
+ const gfx::Rect& bounds) OVERRIDE;
#if defined(OS_CHROMEOS)
// ui::DisplayConfigurator::Observer overrides.
@@ -71,10 +84,16 @@ class ShellDesktopController
ui::DisplayConfigurator::DisplayState>& displays) OVERRIDE;
#endif
- private:
- // Creates the window that hosts the app.
- void CreateRootWindow();
+ aura::WindowTreeHost* host() {
+ return host_.get();
+ };
+
+ protected:
+ // Creates and sets the aura clients and window manager stuffs. Subclass may
+ // initialize different sets of the clients.
+ virtual void InitWindowManager();
+ private:
// Closes and destroys the root window hosting the app.
void DestroyRootWindow();
@@ -86,11 +105,18 @@ class ShellDesktopController
scoped_ptr<ui::DisplayConfigurator> display_configurator_;
#endif
- // Enable a minimal set of views::corewm to be initialized.
- scoped_ptr<wm::WMTestHelper> wm_test_helper_;
-
scoped_ptr<aura::TestScreen> test_screen_;
+ scoped_ptr<aura::WindowTreeHost> host_;
+
+ scoped_ptr<wm::CompoundEventFilter> root_window_event_filter_;
+
+ scoped_ptr<aura::client::DefaultCaptureClient> capture_client_;
+
+ scoped_ptr<wm::InputMethodEventFilter> input_method_filter_;
+
+ scoped_ptr<aura::client::FocusClient> focus_client_;
+
scoped_ptr<wm::CursorManager> cursor_manager_;
scoped_ptr<wm::UserActivityDetector> user_activity_detector_;

Powered by Google App Engine
This is Rietveld 408576698