| 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 | 12 |
| 12 namespace aura { | 13 namespace aura { |
| 13 | 14 |
| 14 // static | 15 // static |
| 15 Env* Env::instance_ = NULL; | 16 Env* Env::instance_ = NULL; |
| 16 | 17 |
| 17 //////////////////////////////////////////////////////////////////////////////// | 18 //////////////////////////////////////////////////////////////////////////////// |
| 18 // Env, public: | 19 // Env, public: |
| 19 | 20 |
| 20 Env::Env() | 21 Env::Env() |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 bool Env::IsMouseButtonDown() const { | 62 bool Env::IsMouseButtonDown() const { |
| 62 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : | 63 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : |
| 63 mouse_button_flags_ != 0; | 64 mouse_button_flags_ != 0; |
| 64 } | 65 } |
| 65 | 66 |
| 66 //////////////////////////////////////////////////////////////////////////////// | 67 //////////////////////////////////////////////////////////////////////////////// |
| 67 // Env, private: | 68 // Env, private: |
| 68 | 69 |
| 69 void Env::Init() { | 70 void Env::Init() { |
| 70 ui::Compositor::Initialize(); | 71 ui::Compositor::Initialize(); |
| 72 |
| 73 if (!ui::PlatformEventSource::GetInstance()) |
| 74 event_source_ = ui::PlatformEventSource::CreateDefault(); |
| 71 } | 75 } |
| 72 | 76 |
| 73 void Env::NotifyWindowInitialized(Window* window) { | 77 void Env::NotifyWindowInitialized(Window* window) { |
| 74 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); | 78 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); |
| 75 } | 79 } |
| 76 | 80 |
| 77 void Env::NotifyHostInitialized(WindowTreeHost* host) { | 81 void Env::NotifyHostInitialized(WindowTreeHost* host) { |
| 78 FOR_EACH_OBSERVER(EnvObserver, observers_, OnHostInitialized(host)); | 82 FOR_EACH_OBSERVER(EnvObserver, observers_, OnHostInitialized(host)); |
| 79 } | 83 } |
| 80 | 84 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 96 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { | 100 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { |
| 97 return scoped_ptr<ui::EventTargetIterator>(); | 101 return scoped_ptr<ui::EventTargetIterator>(); |
| 98 } | 102 } |
| 99 | 103 |
| 100 ui::EventTargeter* Env::GetEventTargeter() { | 104 ui::EventTargeter* Env::GetEventTargeter() { |
| 101 NOTREACHED(); | 105 NOTREACHED(); |
| 102 return NULL; | 106 return NULL; |
| 103 } | 107 } |
| 104 | 108 |
| 105 } // namespace aura | 109 } // namespace aura |
| OLD | NEW |