Remove ExtensionPrefs::SetDidExtensionEscalatePermissions.
[chromium-blink-merge.git] / extensions / shell / browser / shell_desktop_controller_aura.h
blob17546c15f76e0243699c7865f004ec5d53276851
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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_AURA_H_
6 #define EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_AURA_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "extensions/shell/browser/desktop_controller.h"
14 #include "ui/aura/client/window_tree_client.h"
15 #include "ui/aura/window_tree_host_observer.h"
17 #if defined(OS_CHROMEOS)
18 #include "chromeos/dbus/power_manager_client.h"
19 #include "ui/display/chromeos/display_configurator.h"
20 #endif
22 namespace aura {
23 class Window;
24 class WindowTreeHost;
25 namespace client {
26 class DefaultCaptureClient;
27 class FocusClient;
31 namespace content {
32 class BrowserContext;
35 namespace gfx {
36 class Size;
39 namespace ui {
40 class UserActivityDetector;
41 #if defined(OS_CHROMEOS)
42 class UserActivityPowerManagerNotifier;
43 #endif
46 namespace wm {
47 class CompoundEventFilter;
48 class CursorManager;
51 namespace extensions {
52 class AppWindowClient;
53 class Extension;
54 class ShellScreen;
56 // Handles desktop-related tasks for app_shell.
57 class ShellDesktopControllerAura
58 : public DesktopController,
59 public aura::client::WindowTreeClient,
60 #if defined(OS_CHROMEOS)
61 public chromeos::PowerManagerClient::Observer,
62 public ui::DisplayConfigurator::Observer,
63 #endif
64 public aura::WindowTreeHostObserver {
65 public:
66 ShellDesktopControllerAura();
67 ~ShellDesktopControllerAura() override;
69 // DesktopController:
70 gfx::Size GetWindowSize() override;
71 AppWindow* CreateAppWindow(content::BrowserContext* context,
72 const Extension* extension) override;
73 void AddAppWindow(gfx::NativeWindow window) override;
74 void RemoveAppWindow(AppWindow* window) override;
75 void CloseAppWindows() override;
77 // aura::client::WindowTreeClient overrides:
78 aura::Window* GetDefaultParent(aura::Window* context,
79 aura::Window* window,
80 const gfx::Rect& bounds) override;
82 #if defined(OS_CHROMEOS)
83 // chromeos::PowerManagerClient::Observer overrides:
84 void PowerButtonEventReceived(bool down,
85 const base::TimeTicks& timestamp) override;
87 // ui::DisplayConfigurator::Observer overrides.
88 void OnDisplayModeChanged(
89 const ui::DisplayConfigurator::DisplayStateList& displays) override;
90 #endif
92 // aura::WindowTreeHostObserver overrides:
93 void OnHostCloseRequested(const aura::WindowTreeHost* host) override;
95 protected:
96 // Creates and sets the aura clients and window manager stuff. Subclass may
97 // initialize different sets of the clients.
98 virtual void InitWindowManager();
100 private:
101 // Creates the window that hosts the app.
102 void CreateRootWindow();
104 // Closes and destroys the root window hosting the app.
105 void DestroyRootWindow();
107 // Returns the dimensions (in pixels) of the primary display, or an empty size
108 // if the dimensions can't be determined or no display is connected.
109 gfx::Size GetPrimaryDisplaySize();
111 #if defined(OS_CHROMEOS)
112 scoped_ptr<ui::DisplayConfigurator> display_configurator_;
113 #endif
115 scoped_ptr<ShellScreen> screen_;
117 scoped_ptr<aura::WindowTreeHost> host_;
119 scoped_ptr<wm::CompoundEventFilter> root_window_event_filter_;
121 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_;
123 scoped_ptr<aura::client::FocusClient> focus_client_;
125 scoped_ptr<wm::CursorManager> cursor_manager_;
127 scoped_ptr<ui::UserActivityDetector> user_activity_detector_;
128 #if defined(OS_CHROMEOS)
129 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
130 #endif
132 scoped_ptr<AppWindowClient> app_window_client_;
134 // NativeAppWindow::Close() deletes the AppWindow.
135 std::vector<AppWindow*> app_windows_;
137 DISALLOW_COPY_AND_ASSIGN(ShellDesktopControllerAura);
140 } // namespace extensions
142 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_AURA_H_