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 #include "ui/aura/env.h" | 5 #include "ui/aura/env.h" |
6 | 6 |
7 #include "ui/aura/env_observer.h" | 7 #include "ui/aura/env_observer.h" |
8 #include "ui/aura/input_state_lookup.h" | 8 #include "ui/aura/input_state_lookup.h" |
9 #include "ui/compositor/compositor.h" | 9 #include "ui/compositor/compositor.h" |
10 #include "ui/events/event_target_iterator.h" | 10 #include "ui/events/event_target_iterator.h" |
11 #include "ui/events/platform/platform_event_source.h" | 11 #include "ui/events/platform/platform_event_source.h" |
12 | 12 |
| 13 #if defined(USE_OZONE) |
| 14 #include "ui/ozone/ozone_platform.h" |
| 15 #endif |
| 16 |
13 namespace aura { | 17 namespace aura { |
14 | 18 |
15 // static | 19 // static |
16 Env* Env::instance_ = NULL; | 20 Env* Env::instance_ = NULL; |
17 | 21 |
18 //////////////////////////////////////////////////////////////////////////////// | 22 //////////////////////////////////////////////////////////////////////////////// |
19 // Env, public: | 23 // Env, public: |
20 | 24 |
21 Env::Env() | 25 Env::Env() |
22 : mouse_button_flags_(0), | 26 : mouse_button_flags_(0), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : | 67 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : |
64 mouse_button_flags_ != 0; | 68 mouse_button_flags_ != 0; |
65 } | 69 } |
66 | 70 |
67 //////////////////////////////////////////////////////////////////////////////// | 71 //////////////////////////////////////////////////////////////////////////////// |
68 // Env, private: | 72 // Env, private: |
69 | 73 |
70 void Env::Init() { | 74 void Env::Init() { |
71 ui::Compositor::Initialize(); | 75 ui::Compositor::Initialize(); |
72 | 76 |
| 77 #if defined(USE_OZONE) |
| 78 ui::OzonePlatform::Initialize(); |
| 79 #endif |
| 80 |
73 if (!ui::PlatformEventSource::GetInstance()) | 81 if (!ui::PlatformEventSource::GetInstance()) |
74 event_source_ = ui::PlatformEventSource::CreateDefault(); | 82 event_source_ = ui::PlatformEventSource::CreateDefault(); |
75 } | 83 } |
76 | 84 |
77 void Env::NotifyWindowInitialized(Window* window) { | 85 void Env::NotifyWindowInitialized(Window* window) { |
78 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); | 86 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); |
79 } | 87 } |
80 | 88 |
81 void Env::NotifyHostInitialized(WindowTreeHost* host) { | 89 void Env::NotifyHostInitialized(WindowTreeHost* host) { |
82 FOR_EACH_OBSERVER(EnvObserver, observers_, OnHostInitialized(host)); | 90 FOR_EACH_OBSERVER(EnvObserver, observers_, OnHostInitialized(host)); |
(...skipping 17 matching lines...) Expand all Loading... |
100 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { | 108 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { |
101 return scoped_ptr<ui::EventTargetIterator>(); | 109 return scoped_ptr<ui::EventTargetIterator>(); |
102 } | 110 } |
103 | 111 |
104 ui::EventTargeter* Env::GetEventTargeter() { | 112 ui::EventTargeter* Env::GetEventTargeter() { |
105 NOTREACHED(); | 113 NOTREACHED(); |
106 return NULL; | 114 return NULL; |
107 } | 115 } |
108 | 116 |
109 } // namespace aura | 117 } // namespace aura |
OLD | NEW |