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

Unified Diff: extensions/shell/browser/shell_desktop_controller.h

Issue 468393005: app_shell: Shut down in response to power button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 6 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: extensions/shell/browser/shell_desktop_controller.h
diff --git a/extensions/shell/browser/shell_desktop_controller.h b/extensions/shell/browser/shell_desktop_controller.h
index 5d7dc764de210638bfc83fbe9e4993dcef33a7df..b99e6181bb55fd0bc1d2027d5b64933316f36b6d 100644
--- a/extensions/shell/browser/shell_desktop_controller.h
+++ b/extensions/shell/browser/shell_desktop_controller.h
@@ -12,6 +12,7 @@
#include "ui/aura/window_tree_host_observer.h"
#if defined(OS_CHROMEOS)
+#include "chromeos/dbus/power_manager_client.h"
#include "ui/display/chromeos/display_configurator.h"
#endif
@@ -55,12 +56,11 @@ class ShellAppWindowController;
// Handles desktop-related tasks for app_shell.
class ShellDesktopController : public aura::client::WindowTreeClient,
- public aura::WindowTreeHostObserver
#if defined(OS_CHROMEOS)
- ,
- public ui::DisplayConfigurator::Observer
+ public chromeos::PowerManagerClient::Observer,
+ public ui::DisplayConfigurator::Observer,
#endif
- {
+ public aura::WindowTreeHostObserver {
public:
ShellDesktopController();
virtual ~ShellDesktopController();
@@ -72,9 +72,6 @@ class ShellDesktopController : public aura::client::WindowTreeClient,
aura::WindowTreeHost* host() { return host_.get(); }
- // Creates the window that hosts the app.
- void CreateRootWindow();
-
// Sets the controller to create/close the app windows. Takes the ownership of
// |app_window_controller|.
void SetAppWindowController(ShellAppWindowController* app_window_controller);
@@ -89,12 +86,17 @@ class ShellDesktopController : public aura::client::WindowTreeClient,
// Sets the screen's work area insets.
void SetDisplayWorkAreaInsets(const gfx::Insets& insets);
- // Overridden from aura::client::WindowTreeClient:
+ // aura::client::WindowTreeClient overrides:
virtual aura::Window* GetDefaultParent(aura::Window* context,
aura::Window* window,
const gfx::Rect& bounds) OVERRIDE;
#if defined(OS_CHROMEOS)
+ // chromeos::PowerManagerClient::Observer overrides:
+ virtual void PowerButtonEventReceived(bool down,
+ const base::TimeTicks& timestamp)
+ OVERRIDE;
+
// ui::DisplayConfigurator::Observer overrides.
virtual void OnDisplayModeChanged(const std::vector<
ui::DisplayConfigurator::DisplayState>& displays) OVERRIDE;
@@ -112,6 +114,9 @@ class ShellDesktopController : public aura::client::WindowTreeClient,
virtual wm::FocusRules* CreateFocusRules();
private:
+ // Creates the window that hosts the app.
+ void CreateRootWindow();
+
// Closes and destroys the root window hosting the app.
void DestroyRootWindow();
« no previous file with comments | « extensions/shell/browser/shell_browser_main_parts.cc ('k') | extensions/shell/browser/shell_desktop_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698