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

Side by Side Diff: ash/system/chromeos/power/power_event_observer.h

Issue 910393002: Disable rendering when suspending on chrome os (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make PowerEventObserver getter cros-specific Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « ash/shell.h ('k') | ash/system/chromeos/power/power_event_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 ASH_SYSTEM_CHROMEOS_POWER_POWER_EVENT_OBSERVER_H_ 5 #ifndef ASH_SYSTEM_CHROMEOS_POWER_POWER_EVENT_OBSERVER_H_
6 #define ASH_SYSTEM_CHROMEOS_POWER_POWER_EVENT_OBSERVER_H_ 6 #define ASH_SYSTEM_CHROMEOS_POWER_POWER_EVENT_OBSERVER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "chromeos/dbus/power_manager_client.h" 12 #include "chromeos/dbus/power_manager_client.h"
13 #include "chromeos/dbus/session_manager_client.h" 13 #include "chromeos/dbus/session_manager_client.h"
14 14
15 namespace ash { 15 namespace ash {
16 16
17 // A class that observes power-management-related events. 17 // A class that observes power-management-related events.
18 class ASH_EXPORT PowerEventObserver 18 class ASH_EXPORT PowerEventObserver
19 : public chromeos::PowerManagerClient::Observer, 19 : public chromeos::PowerManagerClient::Observer,
20 public chromeos::SessionManagerClient::Observer { 20 public chromeos::SessionManagerClient::Observer {
21 public: 21 public:
22 // This class registers/unregisters itself as an observer in ctor/dtor. 22 // This class registers/unregisters itself as an observer in ctor/dtor.
23 PowerEventObserver(); 23 PowerEventObserver();
24 ~PowerEventObserver() override; 24 ~PowerEventObserver() override;
25 25
26 // Called by the WebUIScreenLocker when all the lock screen animations have
27 // completed. This really should be implemented via an observer but since
28 // ash/ isn't allowed to depend on chrome/ we need to have the
29 // WebUIScreenLocker reach into ash::Shell to make this call.
30 void OnLockAnimationsComplete();
31
26 // chromeos::PowerManagerClient::Observer overrides: 32 // chromeos::PowerManagerClient::Observer overrides:
27 void BrightnessChanged(int level, bool user_initiated) override; 33 void BrightnessChanged(int level, bool user_initiated) override;
28 void SuspendImminent() override; 34 void SuspendImminent() override;
29 void SuspendDone(const base::TimeDelta& sleep_duration) override; 35 void SuspendDone(const base::TimeDelta& sleep_duration) override;
30 36
31 // chromeos::SessionManagerClient::Observer overrides. 37 // chromeos::SessionManagerClient::Observer overrides.
32 void ScreenIsLocked() override; 38 void ScreenIsLocked() override;
33 void ScreenIsUnlocked() override; 39 void ScreenIsUnlocked() override;
34 40
35 // Is the screen currently locked? 41 // Is the screen currently locked?
36 bool screen_locked_; 42 bool screen_locked_;
37 43
38 // If set, called when the lock screen has been shown to confirm that the 44 // Have the lock screen animations completed?
39 // system is ready to be suspended. 45 bool waiting_for_lock_screen_animations_;
46
47 // If set, called when the lock screen animations have completed to confirm
48 // that the system is ready to be suspended.
40 base::Closure screen_lock_callback_; 49 base::Closure screen_lock_callback_;
41 50
42 private: 51 private:
43 DISALLOW_COPY_AND_ASSIGN(PowerEventObserver); 52 DISALLOW_COPY_AND_ASSIGN(PowerEventObserver);
44 }; 53 };
45 54
46 } // namespace chromeos 55 } // namespace chromeos
47 56
48 #endif // ASH_SYSTEM_CHROMEOS_POWER_POWER_EVENT_OBSERVER_H_ 57 #endif // ASH_SYSTEM_CHROMEOS_POWER_POWER_EVENT_OBSERVER_H_
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/system/chromeos/power/power_event_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698