Index: ash/wm/maximize_mode/maximize_mode_controller.h |
diff --git a/ash/wm/maximize_mode/maximize_mode_controller.h b/ash/wm/maximize_mode/maximize_mode_controller.h |
index 86e5acaa63d03122ef42bf6164c13f7eda46fd7d..0663464c5b789986b5a1e3c2a1b3d1214c2b3e93 100644 |
--- a/ash/wm/maximize_mode/maximize_mode_controller.h |
+++ b/ash/wm/maximize_mode/maximize_mode_controller.h |
@@ -7,8 +7,10 @@ |
#include "ash/accelerometer/accelerometer_observer.h" |
#include "ash/ash_export.h" |
+#include "ash/display/display_manager.h" |
#include "base/macros.h" |
#include "base/memory/scoped_ptr.h" |
+#include "ui/message_center/message_center.h" |
namespace ash { |
@@ -39,6 +41,28 @@ class ASH_EXPORT MaximizeModeController : public AccelerometerObserver { |
const gfx::Vector3dF& lid) OVERRIDE; |
private: |
+ // A message center notification blocker used to suppress screen rotation |
+ // events caused by accelerometer events. |
+ class MaximizeModeNotificationBlocker |
flackr
2014/05/08 18:04:00
Can you forward declare the class here, and put fu
bruthig
2014/05/08 21:15:33
Done.
|
+ : public message_center::NotificationBlocker { |
+ public: |
+ MaximizeModeNotificationBlocker(); |
+ virtual ~MaximizeModeNotificationBlocker(); |
+ |
+ virtual void SetShouldShowNotification(bool should_show); |
flackr
2014/05/08 18:04:00
nit: Short comment.
bruthig
2014/05/08 21:15:33
Done.
|
+ |
+ // message_center::NotificationBlocker: |
+ virtual bool ShouldShowNotificationAsPopup( |
+ const message_center::NotifierId& notifier_id) const OVERRIDE; |
+ virtual bool ShouldShowNotification( |
+ const message_center::NotifierId& notifier_id) const OVERRIDE; |
+ |
+ private: |
+ // When true will display notifications |
+ bool show_notifications_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(MaximizeModeNotificationBlocker); |
+ }; |
// Detect hinge rotation from |base| and |lid| accelerometers and |
// automatically start / stop maximize mode. |
void HandleHingeRotation(const gfx::Vector3dF& base, |
@@ -48,6 +72,11 @@ class ASH_EXPORT MaximizeModeController : public AccelerometerObserver { |
// screen. |
void HandleScreenRotation(const gfx::Vector3dF& lid); |
+ // Sets the display rotation and suppresses display notifications. |
+ void SetDisplayRotation(DisplayManager* display_manager, |
+ int64 display_id, |
+ gfx::Display::Rotation rotation); |
+ |
// Enables MaximizeModeWindowManager, and determines the current state of |
// rotation lock. |
void EnterMaximizeMode(); |
@@ -60,6 +89,10 @@ class ASH_EXPORT MaximizeModeController : public AccelerometerObserver { |
// mode is engaged. |
scoped_ptr<MaximizeModeEventBlocker> event_blocker_; |
+ // Notification blocker to prevent display notifications in |
+ // the message center. |
+ MaximizeModeNotificationBlocker notification_blocker_; |
+ |
// When true calls to OnAccelerometerUpdated will not rotate the display. |
bool rotation_locked_; |