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

Side by Side Diff: extensions/shell/browser/shell_desktop_controller_aura.h

Issue 696063008: Refactor ShellDesktopController and ShellNativeAppWindow to allow for non-aura implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: + Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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 void PowerButtonEventReceived(bool down,
85 const base::TimeTicks& timestamp) 86 const base::TimeTicks& timestamp) override;
86 override;
87 87
88 // ui::DisplayConfigurator::Observer overrides. 88 // ui::DisplayConfigurator::Observer overrides.
89 virtual void OnDisplayModeChanged(const std::vector< 89 void OnDisplayModeChanged(
90 ui::DisplayConfigurator::DisplayState>& displays) override; 90 const std::vector<ui::DisplayConfigurator::DisplayState>& displays)
91 override;
91 #endif 92 #endif
92 93
93 // aura::WindowTreeHostObserver overrides: 94 // aura::WindowTreeHostObserver overrides:
94 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; 95 void OnHostCloseRequested(const aura::WindowTreeHost* host) override;
95 96
96 protected: 97 protected:
97 // Creates and sets the aura clients and window manager stuff. Subclass may 98 // Creates and sets the aura clients and window manager stuff. Subclass may
98 // initialize different sets of the clients. 99 // initialize different sets of the clients.
99 virtual void InitWindowManager(); 100 virtual void InitWindowManager();
100 101
(...skipping 29 matching lines...) Expand all
130 scoped_ptr<wm::UserActivityDetector> user_activity_detector_; 131 scoped_ptr<wm::UserActivityDetector> user_activity_detector_;
131 #if defined(OS_CHROMEOS) 132 #if defined(OS_CHROMEOS)
132 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; 133 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
133 #endif 134 #endif
134 135
135 scoped_ptr<AppWindowClient> app_window_client_; 136 scoped_ptr<AppWindowClient> app_window_client_;
136 137
137 // NativeAppWindow::Close() deletes the AppWindow. 138 // NativeAppWindow::Close() deletes the AppWindow.
138 std::vector<AppWindow*> app_windows_; 139 std::vector<AppWindow*> app_windows_;
139 140
140 DISALLOW_COPY_AND_ASSIGN(ShellDesktopController); 141 DISALLOW_COPY_AND_ASSIGN(ShellDesktopControllerAura);
141 }; 142 };
142 143
143 } // namespace extensions 144 } // namespace extensions
144 145
145 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ 146 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_AURA_H_
OLDNEW
« no previous file with comments | « extensions/shell/browser/shell_desktop_controller.cc ('k') | extensions/shell/browser/shell_desktop_controller_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698