| 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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/threading/thread_local.h" | 8 #include "base/threading/thread_local.h" |
| 9 #include "ui/aura/env_observer.h" | 9 #include "ui/aura/env_observer.h" |
| 10 #include "ui/aura/input_state_lookup.h" | 10 #include "ui/aura/input_state_lookup.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : | 64 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : |
| 65 mouse_button_flags_ != 0; | 65 mouse_button_flags_ != 0; |
| 66 } | 66 } |
| 67 | 67 |
| 68 //////////////////////////////////////////////////////////////////////////////// | 68 //////////////////////////////////////////////////////////////////////////////// |
| 69 // Env, private: | 69 // Env, private: |
| 70 | 70 |
| 71 Env::Env() | 71 Env::Env() |
| 72 : mouse_button_flags_(0), | 72 : mouse_button_flags_(0), |
| 73 is_touch_down_(false), | 73 is_touch_down_(false), |
| 74 input_state_lookup_(InputStateLookup::Create().Pass()), | 74 input_state_lookup_(InputStateLookup::Create()), |
| 75 context_factory_(NULL) { | 75 context_factory_(NULL) { |
| 76 DCHECK(lazy_tls_ptr.Pointer()->Get() == NULL); | 76 DCHECK(lazy_tls_ptr.Pointer()->Get() == NULL); |
| 77 lazy_tls_ptr.Pointer()->Set(this); | 77 lazy_tls_ptr.Pointer()->Set(this); |
| 78 } | 78 } |
| 79 | 79 |
| 80 Env::~Env() { | 80 Env::~Env() { |
| 81 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWillDestroyEnv()); | 81 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWillDestroyEnv()); |
| 82 DCHECK_EQ(this, lazy_tls_ptr.Pointer()->Get()); | 82 DCHECK_EQ(this, lazy_tls_ptr.Pointer()->Get()); |
| 83 lazy_tls_ptr.Pointer()->Set(NULL); | 83 lazy_tls_ptr.Pointer()->Set(NULL); |
| 84 } | 84 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { | 119 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { |
| 120 return nullptr; | 120 return nullptr; |
| 121 } | 121 } |
| 122 | 122 |
| 123 ui::EventTargeter* Env::GetEventTargeter() { | 123 ui::EventTargeter* Env::GetEventTargeter() { |
| 124 NOTREACHED(); | 124 NOTREACHED(); |
| 125 return NULL; | 125 return NULL; |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace aura | 128 } // namespace aura |
| OLD | NEW |