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..d7eb9c3c5c30d84e0829694a4e5252451c03c0d2 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" |
oshima
2014/05/30 16:22:51
nit: this can be forward decl, i thin.
Jun Mukai
2014/05/30 19:57:47
Done.
|
@@ -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; |
James Cook
2014/05/30 17:30:18
nit: alphabetize
Jun Mukai
2014/05/30 19:57:47
Done.
|
+class InputMethodEventFilter; |
class UserActivityDetector; |
-class WMTestHelper; |
} |
namespace apps { |
@@ -41,11 +48,11 @@ namespace apps { |
class ShellAppWindow; |
// Handles desktop-related tasks for app_shell. |
-class ShellDesktopController |
+class ShellDesktopController : public aura::client::WindowTreeClient, |
#if defined(OS_CHROMEOS) |
- : public ui::DisplayConfigurator::Observer |
+ public ui::DisplayConfigurator::Observer, |
#endif |
- { |
+ public aura::WindowTreeHostObserver { |
oshima
2014/05/30 16:22:51
nit: move WTHO before ui::DisplayConfigurator::Obs
Jun Mukai
2014/05/30 19:57:47
Done.
|
public: |
ShellDesktopController(); |
virtual ~ShellDesktopController(); |
@@ -55,6 +62,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 +72,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 +83,19 @@ class ShellDesktopController |
ui::DisplayConfigurator::DisplayState>& displays) OVERRIDE; |
#endif |
- private: |
- // Creates the window that hosts the app. |
- void CreateRootWindow(); |
+ // aura::WindowTreeHostObserver overrides: |
+ virtual void OnHostCloseRequested(const aura::WindowTreeHost* host) OVERRIDE; |
+ |
+ aura::WindowTreeHost* host() { |
James Cook
2014/05/30 17:30:18
optional nit: move up near instance() because it i
Jun Mukai
2014/05/30 19:57:47
Done.
|
+ return host_.get(); |
+ }; |
+ protected: |
+ // Creates and sets the aura clients and window manager stuffs. Subclass may |
James Cook
2014/05/30 17:30:18
nit: stuffs -> stuff
Jun Mukai
2014/05/30 19:57:47
Done.
|
+ // initialize different sets of the clients. |
+ virtual void InitWindowManager(); |
+ |
+ private: |
// Closes and destroys the root window hosting the app. |
void DestroyRootWindow(); |
@@ -86,11 +107,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_; |