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 EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ | 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_AURA_H_ |
| 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ | 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_AURA_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "extensions/shell/browser/desktop_controller.h" | 13 #include "extensions/shell/browser/desktop_controller.h" |
| 14 #include "ui/aura/client/window_tree_client.h" | 14 #include "ui/aura/client/window_tree_client.h" |
| 15 #include "ui/aura/window_tree_host_observer.h" | 15 #include "ui/aura/window_tree_host_observer.h" |
| 16 | 16 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 class CursorManager; | 48 class CursorManager; |
| 49 class InputMethodEventFilter; | 49 class InputMethodEventFilter; |
| 50 class UserActivityDetector; | 50 class UserActivityDetector; |
| 51 } | 51 } |
| 52 | 52 |
| 53 namespace extensions { | 53 namespace extensions { |
| 54 class AppWindowClient; | 54 class AppWindowClient; |
| 55 class Extension; | 55 class Extension; |
| 56 | 56 |
| 57 // Handles desktop-related tasks for app_shell. | 57 // Handles desktop-related tasks for app_shell. |
| 58 class ShellDesktopController : public DesktopController, | 58 class ShellDesktopControllerAura |
| 59 public aura::client::WindowTreeClient, | 59 : public DesktopController, |
| 60 public aura::client::WindowTreeClient, | |
| 60 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 61 public chromeos::PowerManagerClient::Observer, | 62 public chromeos::PowerManagerClient::Observer, |
| 62 public ui::DisplayConfigurator::Observer, | 63 public ui::DisplayConfigurator::Observer, |
| 63 #endif | 64 #endif |
| 64 public aura::WindowTreeHostObserver { | 65 public aura::WindowTreeHostObserver { |
| 65 public: | 66 public: |
| 66 ShellDesktopController(); | 67 ShellDesktopControllerAura(); |
| 67 ~ShellDesktopController() override; | 68 ~ShellDesktopControllerAura() override; |
| 68 | 69 |
| 69 // DesktopController: | 70 // DesktopController: |
| 70 aura::WindowTreeHost* GetHost() override; | 71 gfx::Size GetWindowSize() override; |
| 71 AppWindow* CreateAppWindow(content::BrowserContext* context, | 72 AppWindow* CreateAppWindow(content::BrowserContext* context, |
| 72 const Extension* extension) override; | 73 const Extension* extension) override; |
| 73 void AddAppWindow(aura::Window* window) override; | 74 void AddAppWindow(gfx::NativeWindow window) override; |
| 74 void RemoveAppWindow(AppWindow* window) override; | 75 void RemoveAppWindow(AppWindow* window) override; |
| 75 void CloseAppWindows() override; | 76 void CloseAppWindows() override; |
| 76 | 77 |
| 77 // aura::client::WindowTreeClient overrides: | 78 // aura::client::WindowTreeClient overrides: |
| 78 aura::Window* GetDefaultParent(aura::Window* context, | 79 aura::Window* GetDefaultParent(aura::Window* context, |
| 79 aura::Window* window, | 80 aura::Window* window, |
| 80 const gfx::Rect& bounds) override; | 81 const gfx::Rect& bounds) override; |
| 81 | 82 |
| 82 #if defined(OS_CHROMEOS) | 83 #if defined(OS_CHROMEOS) |
| 83 // chromeos::PowerManagerClient::Observer overrides: | 84 // chromeos::PowerManagerClient::Observer overrides: |
| 84 virtual void PowerButtonEventReceived(bool down, | 85 virtual void PowerButtonEventReceived( |
|
James Cook
2014/11/11 18:23:52
nit: no virtual
Yoyo Zhou
2014/11/15 01:05:44
Done.
| |
| 85 const base::TimeTicks& timestamp) | 86 bool down, |
| 86 override; | 87 const base::TimeTicks& timestamp) override; |
| 87 | 88 |
| 88 // ui::DisplayConfigurator::Observer overrides. | 89 // ui::DisplayConfigurator::Observer overrides. |
| 89 virtual void OnDisplayModeChanged(const std::vector< | 90 virtual void OnDisplayModeChanged( |
|
James Cook
2014/11/11 18:23:52
nit: no virtual
Yoyo Zhou
2014/11/15 01:05:44
Done.
| |
| 90 ui::DisplayConfigurator::DisplayState>& displays) override; | 91 const std::vector<ui::DisplayConfigurator::DisplayState>& displays) |
| 92 override; | |
| 91 #endif | 93 #endif |
| 92 | 94 |
| 93 // aura::WindowTreeHostObserver overrides: | 95 // aura::WindowTreeHostObserver overrides: |
| 94 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; | 96 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; |
| 95 | 97 |
| 96 protected: | 98 protected: |
| 97 // Creates and sets the aura clients and window manager stuff. Subclass may | 99 // Creates and sets the aura clients and window manager stuff. Subclass may |
| 98 // initialize different sets of the clients. | 100 // initialize different sets of the clients. |
| 99 virtual void InitWindowManager(); | 101 virtual void InitWindowManager(); |
| 100 | 102 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 130 scoped_ptr<wm::UserActivityDetector> user_activity_detector_; | 132 scoped_ptr<wm::UserActivityDetector> user_activity_detector_; |
| 131 #if defined(OS_CHROMEOS) | 133 #if defined(OS_CHROMEOS) |
| 132 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; | 134 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; |
| 133 #endif | 135 #endif |
| 134 | 136 |
| 135 scoped_ptr<AppWindowClient> app_window_client_; | 137 scoped_ptr<AppWindowClient> app_window_client_; |
| 136 | 138 |
| 137 // NativeAppWindow::Close() deletes the AppWindow. | 139 // NativeAppWindow::Close() deletes the AppWindow. |
| 138 std::vector<AppWindow*> app_windows_; | 140 std::vector<AppWindow*> app_windows_; |
| 139 | 141 |
| 140 DISALLOW_COPY_AND_ASSIGN(ShellDesktopController); | 142 DISALLOW_COPY_AND_ASSIGN(ShellDesktopControllerAura); |
| 141 }; | 143 }; |
| 142 | 144 |
| 143 } // namespace extensions | 145 } // namespace extensions |
| 144 | 146 |
| 145 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ | 147 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_AURA_H_ |
| OLD | NEW |