Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ | 5 #ifndef APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ |
| 6 #define APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ | 6 #define APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 namespace wm { | 42 namespace wm { |
| 43 class CompoundEventFilter; | 43 class CompoundEventFilter; |
| 44 class CursorManager; | 44 class CursorManager; |
| 45 class InputMethodEventFilter; | 45 class InputMethodEventFilter; |
| 46 class UserActivityDetector; | 46 class UserActivityDetector; |
| 47 } | 47 } |
| 48 | 48 |
| 49 namespace apps { | 49 namespace apps { |
| 50 | 50 |
| 51 class ShellAppWindow; | 51 class ShellAppWindow; |
| 52 class ShellAppWindowController; | |
| 52 | 53 |
| 53 // Handles desktop-related tasks for app_shell. | 54 // Handles desktop-related tasks for app_shell. |
| 54 class ShellDesktopController : public aura::client::WindowTreeClient, | 55 class ShellDesktopController : public aura::client::WindowTreeClient, |
| 55 public aura::WindowTreeHostObserver | 56 public aura::WindowTreeHostObserver |
| 56 #if defined(OS_CHROMEOS) | 57 #if defined(OS_CHROMEOS) |
| 57 , | 58 , |
| 58 public ui::DisplayConfigurator::Observer | 59 public ui::DisplayConfigurator::Observer |
| 59 #endif | 60 #endif |
| 60 { | 61 { |
| 61 public: | 62 public: |
| 62 ShellDesktopController(); | 63 ShellDesktopController(); |
| 63 virtual ~ShellDesktopController(); | 64 virtual ~ShellDesktopController(); |
| 64 | 65 |
| 65 // Returns the single instance of the desktop. (Stateless functions like | 66 // Returns the single instance of the desktop. (Stateless functions like |
| 66 // ShellAppWindowCreateFunction need to be able to access the desktop, so | 67 // ShellAppWindowCreateFunction need to be able to access the desktop, so |
| 67 // we need a singleton somewhere). | 68 // we need a singleton somewhere). |
| 68 static ShellDesktopController* instance(); | 69 static ShellDesktopController* instance(); |
| 69 | 70 |
| 70 aura::WindowTreeHost* host() { return host_.get(); } | 71 aura::WindowTreeHost* host() { return host_.get(); } |
| 71 | 72 |
| 72 // Creates the window that hosts the app. | 73 // Creates the window that hosts the app. |
| 73 void CreateRootWindow(); | 74 void CreateRootWindow(); |
| 74 | 75 |
| 76 void SetAppWindowController(ShellAppWindowController* app_window_controller); | |
|
oshima
2014/06/16 18:40:08
looks like you can just pass it in ctor?
Jun Mukai
2014/06/16 18:48:15
The DefaultShellAppWindowController (of app_shell)
oshima
2014/06/16 18:53:16
I think this part needs ovehaul later on, so I'm f
| |
| 77 | |
| 75 // Creates a new app window and adds it to the desktop. The desktop maintains | 78 // Creates a new app window and adds it to the desktop. The desktop maintains |
| 76 // ownership of the window. | 79 // ownership of the window. |
| 77 ShellAppWindow* CreateAppWindow(content::BrowserContext* context); | 80 ShellAppWindow* CreateAppWindow(content::BrowserContext* context); |
| 78 | 81 |
| 79 // Closes and destroys the app window. | 82 // Closes and destroys the app windows. |
| 80 void CloseAppWindow(); | 83 void CloseAppWindows(); |
| 81 | 84 |
| 82 // Overridden from aura::client::WindowTreeClient: | 85 // Overridden from aura::client::WindowTreeClient: |
| 83 virtual aura::Window* GetDefaultParent(aura::Window* context, | 86 virtual aura::Window* GetDefaultParent(aura::Window* context, |
| 84 aura::Window* window, | 87 aura::Window* window, |
| 85 const gfx::Rect& bounds) OVERRIDE; | 88 const gfx::Rect& bounds) OVERRIDE; |
| 86 | 89 |
| 87 #if defined(OS_CHROMEOS) | 90 #if defined(OS_CHROMEOS) |
| 88 // ui::DisplayConfigurator::Observer overrides. | 91 // ui::DisplayConfigurator::Observer overrides. |
| 89 virtual void OnDisplayModeChanged(const std::vector< | 92 virtual void OnDisplayModeChanged(const std::vector< |
| 90 ui::DisplayConfigurator::DisplayState>& displays) OVERRIDE; | 93 ui::DisplayConfigurator::DisplayState>& displays) OVERRIDE; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 scoped_ptr<aura::client::FocusClient> focus_client_; | 126 scoped_ptr<aura::client::FocusClient> focus_client_; |
| 124 | 127 |
| 125 scoped_ptr<wm::CursorManager> cursor_manager_; | 128 scoped_ptr<wm::CursorManager> cursor_manager_; |
| 126 | 129 |
| 127 scoped_ptr<wm::UserActivityDetector> user_activity_detector_; | 130 scoped_ptr<wm::UserActivityDetector> user_activity_detector_; |
| 128 #if defined(OS_CHROMEOS) | 131 #if defined(OS_CHROMEOS) |
| 129 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; | 132 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; |
| 130 #endif | 133 #endif |
| 131 | 134 |
| 132 // The desktop supports a single app window. | 135 // The desktop supports a single app window. |
| 133 scoped_ptr<ShellAppWindow> app_window_; | 136 scoped_ptr<ShellAppWindowController> app_window_controller_; |
| 134 | 137 |
| 135 DISALLOW_COPY_AND_ASSIGN(ShellDesktopController); | 138 DISALLOW_COPY_AND_ASSIGN(ShellDesktopController); |
| 136 }; | 139 }; |
| 137 | 140 |
| 138 } // namespace apps | 141 } // namespace apps |
| 139 | 142 |
| 140 #endif // APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ | 143 #endif // APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ |
| OLD | NEW |