OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_AURA_ENV_H_ | 5 #ifndef UI_AURA_ENV_H_ |
6 #define UI_AURA_ENV_H_ | 6 #define UI_AURA_ENV_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void set_mouse_button_flags(int mouse_button_flags) { | 44 void set_mouse_button_flags(int mouse_button_flags) { |
45 mouse_button_flags_ = mouse_button_flags; | 45 mouse_button_flags_ = mouse_button_flags; |
46 } | 46 } |
47 | 47 |
48 // Gets/sets the last mouse location seen in a mouse event in the screen | 48 // Gets/sets the last mouse location seen in a mouse event in the screen |
49 // coordinates. | 49 // coordinates. |
50 const gfx::Point& last_mouse_location() const { return last_mouse_location_; } | 50 const gfx::Point& last_mouse_location() const { return last_mouse_location_; } |
51 void SetLastMouseLocation(const Window& window, | 51 void SetLastMouseLocation(const Window& window, |
52 const gfx::Point& location_in_root); | 52 const gfx::Point& location_in_root); |
53 | 53 |
| 54 // If |cursor_shown| is false, sets the last_mouse_position to an invalid |
| 55 // location. If |cursor_shown| is true, restores the last_mouse_position. |
| 56 void SetCursorShown(bool cursor_shown); |
| 57 |
54 // Whether any touch device is currently down. | 58 // Whether any touch device is currently down. |
55 bool is_touch_down() const { return is_touch_down_; } | 59 bool is_touch_down() const { return is_touch_down_; } |
56 void set_touch_down(bool value) { is_touch_down_ = value; } | 60 void set_touch_down(bool value) { is_touch_down_ = value; } |
57 | 61 |
58 // Whether RenderWidgetHostViewAura::OnPaint() should paint white background | 62 // Whether RenderWidgetHostViewAura::OnPaint() should paint white background |
59 // when backing store is not present. Default is true. | 63 // when backing store is not present. Default is true. |
60 // In some cases when page is using transparent background painting white | 64 // In some cases when page is using transparent background painting white |
61 // background before backing store is initialized causes a white splash. | 65 // background before backing store is initialized causes a white splash. |
62 bool render_white_bg() const { return render_white_bg_; } | 66 bool render_white_bg() const { return render_white_bg_; } |
63 void set_render_white_bg(bool value) { render_white_bg_ = value; } | 67 void set_render_white_bg(bool value) { render_white_bg_ = value; } |
(...skipping 29 matching lines...) Expand all Loading... |
93 | 97 |
94 ObserverList<EnvObserver> observers_; | 98 ObserverList<EnvObserver> observers_; |
95 #if !defined(OS_MACOSX) | 99 #if !defined(OS_MACOSX) |
96 scoped_ptr<MessageLoop::Dispatcher> dispatcher_; | 100 scoped_ptr<MessageLoop::Dispatcher> dispatcher_; |
97 #endif | 101 #endif |
98 | 102 |
99 static Env* instance_; | 103 static Env* instance_; |
100 int mouse_button_flags_; | 104 int mouse_button_flags_; |
101 // Location of last mouse event, in screen coordinates. | 105 // Location of last mouse event, in screen coordinates. |
102 gfx::Point last_mouse_location_; | 106 gfx::Point last_mouse_location_; |
| 107 // If the cursor is hidden, saves the previous last_mouse_position. |
| 108 gfx::Point hidden_cursor_location_; |
| 109 bool is_cursor_hidden_; |
103 bool is_touch_down_; | 110 bool is_touch_down_; |
104 bool render_white_bg_; | 111 bool render_white_bg_; |
105 client::StackingClient* stacking_client_; | 112 client::StackingClient* stacking_client_; |
106 scoped_ptr<DisplayManager> display_manager_; | 113 scoped_ptr<DisplayManager> display_manager_; |
107 scoped_ptr<EventFilter> event_filter_; | 114 scoped_ptr<EventFilter> event_filter_; |
108 | 115 |
109 #if defined(USE_X11) | 116 #if defined(USE_X11) |
110 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_; | 117 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_; |
111 #endif | 118 #endif |
112 | 119 |
113 DISALLOW_COPY_AND_ASSIGN(Env); | 120 DISALLOW_COPY_AND_ASSIGN(Env); |
114 }; | 121 }; |
115 | 122 |
116 } // namespace aura | 123 } // namespace aura |
117 | 124 |
118 #endif // UI_AURA_ENV_H_ | 125 #endif // UI_AURA_ENV_H_ |
OLD | NEW |