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

Unified Diff: chrome/browser/chromeos/power/power_button_observer.h

Issue 8976012: chromeos: Implement power button animations for Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update copyright year to 2012 Created 8 years, 12 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: chrome/browser/chromeos/power/power_button_observer.h
diff --git a/chrome/browser/chromeos/power/power_button_observer.h b/chrome/browser/chromeos/power/power_button_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..97a1cfa2ba5aad699b2c7155307ee2b67ac0e8b1
--- /dev/null
+++ b/chrome/browser/chromeos/power/power_button_observer.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_POWER_POWER_BUTTON_OBSERVER_H_
+#define CHROME_BROWSER_CHROMEOS_POWER_POWER_BUTTON_OBSERVER_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "chrome/browser/chromeos/dbus/power_manager_client.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+
+namespace chromeos {
+
+// Listens for power button, login, and screen lock events and passes them to
+// the Aura shell's PowerButtonController class.
+class PowerButtonObserver : public content::NotificationObserver,
+ public PowerManagerClient::Observer {
+ public:
+ PowerButtonObserver();
+ virtual ~PowerButtonObserver();
+
+ private:
+ // content::NotificationObserver implementation:
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ // PowerManagerClient::Observer implementation.
+ virtual void PowerButtonStateChanged(
+ bool down, const base::TimeTicks& timestamp) OVERRIDE;
+ virtual void LockButtonStateChanged(
+ bool down, const base::TimeTicks& timestamp) OVERRIDE;
+ virtual void LockScreen() OVERRIDE;
+
+ content::NotificationRegistrar registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(PowerButtonObserver);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_POWER_POWER_BUTTON_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698