OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SHARED_IMMERSIVE_CONTEXT_H_ | 5 #ifndef ASH_SHARED_IMMERSIVE_CONTEXT_H_ |
6 #define ASH_SHARED_IMMERSIVE_CONTEXT_H_ | 6 #define ASH_SHARED_IMMERSIVE_CONTEXT_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 14 matching lines...) Expand all Loading... |
25 // restrictions. ImmersiveContext enables ImmersiveFullscreenController to be | 25 // restrictions. ImmersiveContext enables ImmersiveFullscreenController to be |
26 // used in these different environments. ImmersiveContext abstracts away all the | 26 // used in these different environments. ImmersiveContext abstracts away all the |
27 // windowing related calls so that ImmersiveFullscreenController does not | 27 // windowing related calls so that ImmersiveFullscreenController does not |
28 // depend upon aura, mus or ash. | 28 // depend upon aura, mus or ash. |
29 // | 29 // |
30 // ImmersiveContext is a singleton. | 30 // ImmersiveContext is a singleton. |
31 class ASH_EXPORT ImmersiveContext { | 31 class ASH_EXPORT ImmersiveContext { |
32 public: | 32 public: |
33 static ImmersiveContext* Get() { return instance_; } | 33 static ImmersiveContext* Get() { return instance_; } |
34 | 34 |
35 // Mirrors that of WmShell::InstallResizeHandleWindowTargeter(), see it | 35 // Mirrors that of ShellPort::InstallResizeHandleWindowTargeter(), see it |
36 // for details | 36 // for details |
37 virtual void InstallResizeHandleWindowTargeter( | 37 virtual void InstallResizeHandleWindowTargeter( |
38 ImmersiveFullscreenController* controller) = 0; | 38 ImmersiveFullscreenController* controller) = 0; |
39 | 39 |
40 // Used to setup state necessary for entering or existing immersive mode. It | 40 // Used to setup state necessary for entering or existing immersive mode. It |
41 // is expected this interacts with the shelf, and installs any other necessary | 41 // is expected this interacts with the shelf, and installs any other necessary |
42 // state. | 42 // state. |
43 virtual void OnEnteringOrExitingImmersive( | 43 virtual void OnEnteringOrExitingImmersive( |
44 ImmersiveFullscreenController* controller, | 44 ImmersiveFullscreenController* controller, |
45 bool entering) = 0; | 45 bool entering) = 0; |
46 | 46 |
47 // Returns the bounds of the display the widget is on, in screen coordinates. | 47 // Returns the bounds of the display the widget is on, in screen coordinates. |
48 virtual gfx::Rect GetDisplayBoundsInScreen(views::Widget* widget) = 0; | 48 virtual gfx::Rect GetDisplayBoundsInScreen(views::Widget* widget) = 0; |
49 | 49 |
50 // See WmShell::AddPointerWatcher for details. | 50 // See ShellPort::AddPointerWatcher for details. |
51 virtual void AddPointerWatcher(views::PointerWatcher* watcher, | 51 virtual void AddPointerWatcher(views::PointerWatcher* watcher, |
52 views::PointerWatcherEventTypes events) = 0; | 52 views::PointerWatcherEventTypes events) = 0; |
53 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; | 53 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; |
54 | 54 |
55 // Returns true if any window has capture. | 55 // Returns true if any window has capture. |
56 virtual bool DoesAnyWindowHaveCapture() = 0; | 56 virtual bool DoesAnyWindowHaveCapture() = 0; |
57 | 57 |
58 // See WmShell::IsMouseEventsEnabled() for details. | 58 // See ShellPort::IsMouseEventsEnabled() for details. |
59 virtual bool IsMouseEventsEnabled() = 0; | 59 virtual bool IsMouseEventsEnabled() = 0; |
60 | 60 |
61 protected: | 61 protected: |
62 ImmersiveContext(); | 62 ImmersiveContext(); |
63 virtual ~ImmersiveContext(); | 63 virtual ~ImmersiveContext(); |
64 | 64 |
65 private: | 65 private: |
66 static ImmersiveContext* instance_; | 66 static ImmersiveContext* instance_; |
67 }; | 67 }; |
68 | 68 |
69 } // namespace ash | 69 } // namespace ash |
70 | 70 |
71 #endif // ASH_SHARED_IMMERSIVE_CONTEXT_H_ | 71 #endif // ASH_SHARED_IMMERSIVE_CONTEXT_H_ |
OLD | NEW |