| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_CONTEXT_H_ |
| 7 |
| 8 #include "base/observer_list.h" |
| 9 #include "content/common/content_export.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 // Provides information about changes within a screen orientation context to a |
| 14 // set of observers of that context. |
| 15 class CONTENT_EXPORT ScreenOrientationContext { |
| 16 public: |
| 17 class Observer { |
| 18 public: |
| 19 // Called when the screen orientation changes. |
| 20 virtual void OnScreenOrientationChange() = 0; |
| 21 |
| 22 // Called when a new lock request is received within this screen |
| 23 // orientation context. |
| 24 virtual void OnNewLockRequest() = 0; |
| 25 |
| 26 protected: |
| 27 virtual ~Observer() {} |
| 28 }; |
| 29 |
| 30 ScreenOrientationContext(); |
| 31 virtual ~ScreenOrientationContext(); |
| 32 |
| 33 void AddObserver(Observer* observer); |
| 34 void RemoveObserver(Observer* observer); |
| 35 |
| 36 // Notifies observers that screen orientation changed. |
| 37 void OnScreenOrientationChange(); |
| 38 |
| 39 // Notifies observers that a new lock request was received. |
| 40 void OnNewLockRequest(); |
| 41 |
| 42 private: |
| 43 ObserverList<Observer, true> observer_list_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationContext); |
| 46 }; |
| 47 |
| 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_CONTEXT_H_ |
| OLD | NEW |