| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 void RemoveObserver(EnvObserver* observer); | 42 void RemoveObserver(EnvObserver* observer); |
| 43 | 43 |
| 44 bool is_mouse_button_down() const { return mouse_button_flags_ != 0; } | 44 bool is_mouse_button_down() const { return mouse_button_flags_ != 0; } |
| 45 void set_mouse_button_flags(int mouse_button_flags) { | 45 void set_mouse_button_flags(int mouse_button_flags) { |
| 46 mouse_button_flags_ = mouse_button_flags; | 46 mouse_button_flags_ = mouse_button_flags; |
| 47 } | 47 } |
| 48 | 48 |
| 49 // Gets/sets the last mouse location seen in a mouse event in the screen | 49 // Gets/sets the last mouse location seen in a mouse event in the screen |
| 50 // coordinates. | 50 // coordinates. |
| 51 const gfx::Point& last_mouse_location() const { return last_mouse_location_; } | 51 const gfx::Point& last_mouse_location() const { return last_mouse_location_; } |
| 52 void SetLastMouseLocation(const Window& window, | 52 void set_last_mouse_location(const gfx::Point& last_mouse_location) { |
| 53 const gfx::Point& location_in_root); | 53 last_mouse_location_ = last_mouse_location; |
| 54 | 54 } |
| 55 // If |cursor_shown| is false, sets the last_mouse_position to an invalid | |
| 56 // location. If |cursor_shown| is true, restores the last_mouse_position. | |
| 57 void SetCursorShown(bool cursor_shown); | |
| 58 | 55 |
| 59 // Whether any touch device is currently down. | 56 // Whether any touch device is currently down. |
| 60 bool is_touch_down() const { return is_touch_down_; } | 57 bool is_touch_down() const { return is_touch_down_; } |
| 61 void set_touch_down(bool value) { is_touch_down_ = value; } | 58 void set_touch_down(bool value) { is_touch_down_ = value; } |
| 62 | 59 |
| 63 // Whether RenderWidgetHostViewAura::OnPaint() should paint white background | 60 // Whether RenderWidgetHostViewAura::OnPaint() should paint white background |
| 64 // when backing store is not present. Default is true. | 61 // when backing store is not present. Default is true. |
| 65 // In some cases when page is using transparent background painting white | 62 // In some cases when page is using transparent background painting white |
| 66 // background before backing store is initialized causes a white splash. | 63 // background before backing store is initialized causes a white splash. |
| 67 bool render_white_bg() const { return render_white_bg_; } | 64 bool render_white_bg() const { return render_white_bg_; } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 96 | 93 |
| 97 ObserverList<EnvObserver> observers_; | 94 ObserverList<EnvObserver> observers_; |
| 98 #if !defined(USE_X11) | 95 #if !defined(USE_X11) |
| 99 scoped_ptr<MessageLoop::Dispatcher> dispatcher_; | 96 scoped_ptr<MessageLoop::Dispatcher> dispatcher_; |
| 100 #endif | 97 #endif |
| 101 | 98 |
| 102 static Env* instance_; | 99 static Env* instance_; |
| 103 int mouse_button_flags_; | 100 int mouse_button_flags_; |
| 104 // Location of last mouse event, in screen coordinates. | 101 // Location of last mouse event, in screen coordinates. |
| 105 gfx::Point last_mouse_location_; | 102 gfx::Point last_mouse_location_; |
| 106 // If the cursor is hidden, saves the previous last_mouse_position. | |
| 107 gfx::Point hidden_cursor_location_; | |
| 108 bool is_cursor_hidden_; | |
| 109 bool is_touch_down_; | 103 bool is_touch_down_; |
| 110 bool render_white_bg_; | 104 bool render_white_bg_; |
| 111 client::StackingClient* stacking_client_; | 105 client::StackingClient* stacking_client_; |
| 112 | 106 |
| 113 #if defined(USE_X11) | 107 #if defined(USE_X11) |
| 114 DeviceListUpdaterAuraX11 device_list_updater_aurax11_; | 108 DeviceListUpdaterAuraX11 device_list_updater_aurax11_; |
| 115 #endif | 109 #endif |
| 116 | 110 |
| 117 DISALLOW_COPY_AND_ASSIGN(Env); | 111 DISALLOW_COPY_AND_ASSIGN(Env); |
| 118 }; | 112 }; |
| 119 | 113 |
| 120 } // namespace aura | 114 } // namespace aura |
| 121 | 115 |
| 122 #endif // UI_AURA_ENV_H_ | 116 #endif // UI_AURA_ENV_H_ |
| OLD | NEW |