| 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 "base/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 context_factory_ = context_factory; | 65 context_factory_ = context_factory; |
| 66 } | 66 } |
| 67 ui::ContextFactory* context_factory() { return context_factory_; } | 67 ui::ContextFactory* context_factory() { return context_factory_; } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 friend class test::EnvTestHelper; | 70 friend class test::EnvTestHelper; |
| 71 friend class Window; | 71 friend class Window; |
| 72 friend class WindowTreeHost; | 72 friend class WindowTreeHost; |
| 73 | 73 |
| 74 Env(); | 74 Env(); |
| 75 virtual ~Env(); | 75 ~Env() override; |
| 76 | 76 |
| 77 // See description of CreateInstance() for deatils of |create_event_source|. | 77 // See description of CreateInstance() for deatils of |create_event_source|. |
| 78 void Init(bool create_event_source); | 78 void Init(bool create_event_source); |
| 79 | 79 |
| 80 // Called by the Window when it is initialized. Notifies observers. | 80 // Called by the Window when it is initialized. Notifies observers. |
| 81 void NotifyWindowInitialized(Window* window); | 81 void NotifyWindowInitialized(Window* window); |
| 82 | 82 |
| 83 // Called by the WindowTreeHost when it is initialized. Notifies observers. | 83 // Called by the WindowTreeHost when it is initialized. Notifies observers. |
| 84 void NotifyHostInitialized(WindowTreeHost* host); | 84 void NotifyHostInitialized(WindowTreeHost* host); |
| 85 | 85 |
| 86 // Invoked by WindowTreeHost when it is activated. Notifies observers. | 86 // Invoked by WindowTreeHost when it is activated. Notifies observers. |
| 87 void NotifyHostActivated(WindowTreeHost* host); | 87 void NotifyHostActivated(WindowTreeHost* host); |
| 88 | 88 |
| 89 // Overridden from ui::EventTarget: | 89 // Overridden from ui::EventTarget: |
| 90 virtual bool CanAcceptEvent(const ui::Event& event) override; | 90 bool CanAcceptEvent(const ui::Event& event) override; |
| 91 virtual ui::EventTarget* GetParentTarget() override; | 91 ui::EventTarget* GetParentTarget() override; |
| 92 virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override; | 92 scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override; |
| 93 virtual ui::EventTargeter* GetEventTargeter() override; | 93 ui::EventTargeter* GetEventTargeter() override; |
| 94 | 94 |
| 95 ObserverList<EnvObserver> observers_; | 95 ObserverList<EnvObserver> observers_; |
| 96 | 96 |
| 97 int mouse_button_flags_; | 97 int mouse_button_flags_; |
| 98 // Location of last mouse event, in screen coordinates. | 98 // Location of last mouse event, in screen coordinates. |
| 99 gfx::Point last_mouse_location_; | 99 gfx::Point last_mouse_location_; |
| 100 bool is_touch_down_; | 100 bool is_touch_down_; |
| 101 | 101 |
| 102 scoped_ptr<InputStateLookup> input_state_lookup_; | 102 scoped_ptr<InputStateLookup> input_state_lookup_; |
| 103 scoped_ptr<ui::PlatformEventSource> event_source_; | 103 scoped_ptr<ui::PlatformEventSource> event_source_; |
| 104 | 104 |
| 105 ui::ContextFactory* context_factory_; | 105 ui::ContextFactory* context_factory_; |
| 106 | 106 |
| 107 DISALLOW_COPY_AND_ASSIGN(Env); | 107 DISALLOW_COPY_AND_ASSIGN(Env); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace aura | 110 } // namespace aura |
| 111 | 111 |
| 112 #endif // UI_AURA_ENV_H_ | 112 #endif // UI_AURA_ENV_H_ |
| OLD | NEW |