| 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/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
| 11 #include "ui/events/event_handler.h" | 11 #include "ui/events/event_handler.h" |
| 12 #include "ui/events/event_target.h" | 12 #include "ui/events/event_target.h" |
| 13 #include "ui/gfx/point.h" | 13 #include "ui/gfx/point.h" |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 class ContextFactory; |
| 16 class PlatformEventSource; | 17 class PlatformEventSource; |
| 17 } | 18 } |
| 18 namespace aura { | 19 namespace aura { |
| 19 | 20 |
| 20 namespace test { | 21 namespace test { |
| 21 class EnvTestHelper; | 22 class EnvTestHelper; |
| 22 } | 23 } |
| 23 | 24 |
| 24 class EnvObserver; | 25 class EnvObserver; |
| 25 class InputStateLookup; | 26 class InputStateLookup; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 // coordinates. | 53 // coordinates. |
| 53 const gfx::Point& last_mouse_location() const { return last_mouse_location_; } | 54 const gfx::Point& last_mouse_location() const { return last_mouse_location_; } |
| 54 void set_last_mouse_location(const gfx::Point& last_mouse_location) { | 55 void set_last_mouse_location(const gfx::Point& last_mouse_location) { |
| 55 last_mouse_location_ = last_mouse_location; | 56 last_mouse_location_ = last_mouse_location; |
| 56 } | 57 } |
| 57 | 58 |
| 58 // Whether any touch device is currently down. | 59 // Whether any touch device is currently down. |
| 59 bool is_touch_down() const { return is_touch_down_; } | 60 bool is_touch_down() const { return is_touch_down_; } |
| 60 void set_touch_down(bool value) { is_touch_down_ = value; } | 61 void set_touch_down(bool value) { is_touch_down_ = value; } |
| 61 | 62 |
| 63 void set_context_factory(ui::ContextFactory* context_factory) { |
| 64 context_factory_ = context_factory; |
| 65 } |
| 66 ui::ContextFactory* context_factory() { return context_factory_; } |
| 67 |
| 62 private: | 68 private: |
| 63 friend class test::EnvTestHelper; | 69 friend class test::EnvTestHelper; |
| 64 friend class Window; | 70 friend class Window; |
| 65 friend class WindowTreeHost; | 71 friend class WindowTreeHost; |
| 66 | 72 |
| 67 Env(); | 73 Env(); |
| 68 virtual ~Env(); | 74 virtual ~Env(); |
| 69 | 75 |
| 70 // See description of CreateInstance() for deatils of |create_event_source|. | 76 // See description of CreateInstance() for deatils of |create_event_source|. |
| 71 void Init(bool create_event_source); | 77 void Init(bool create_event_source); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 88 ObserverList<EnvObserver> observers_; | 94 ObserverList<EnvObserver> observers_; |
| 89 | 95 |
| 90 int mouse_button_flags_; | 96 int mouse_button_flags_; |
| 91 // Location of last mouse event, in screen coordinates. | 97 // Location of last mouse event, in screen coordinates. |
| 92 gfx::Point last_mouse_location_; | 98 gfx::Point last_mouse_location_; |
| 93 bool is_touch_down_; | 99 bool is_touch_down_; |
| 94 | 100 |
| 95 scoped_ptr<InputStateLookup> input_state_lookup_; | 101 scoped_ptr<InputStateLookup> input_state_lookup_; |
| 96 scoped_ptr<ui::PlatformEventSource> event_source_; | 102 scoped_ptr<ui::PlatformEventSource> event_source_; |
| 97 | 103 |
| 104 ui::ContextFactory* context_factory_; |
| 105 |
| 98 DISALLOW_COPY_AND_ASSIGN(Env); | 106 DISALLOW_COPY_AND_ASSIGN(Env); |
| 99 }; | 107 }; |
| 100 | 108 |
| 101 } // namespace aura | 109 } // namespace aura |
| 102 | 110 |
| 103 #endif // UI_AURA_ENV_H_ | 111 #endif // UI_AURA_ENV_H_ |
| OLD | NEW |