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

Side by Side Diff: content/browser/screen_orientation/screen_orientation_context.h

Issue 549603003: Create Mojo service for locking/unlocking screen orientation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 6 years, 3 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
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698