| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : | 59 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : |
| 60 mouse_button_flags_ != 0; | 60 mouse_button_flags_ != 0; |
| 61 } | 61 } |
| 62 | 62 |
| 63 //////////////////////////////////////////////////////////////////////////////// | 63 //////////////////////////////////////////////////////////////////////////////// |
| 64 // Env, private: | 64 // Env, private: |
| 65 | 65 |
| 66 Env::Env() | 66 Env::Env() |
| 67 : mouse_button_flags_(0), | 67 : mouse_button_flags_(0), |
| 68 is_touch_down_(false), | 68 is_touch_down_(false), |
| 69 input_state_lookup_(InputStateLookup::Create().Pass()) { | 69 input_state_lookup_(InputStateLookup::Create().Pass()), |
| 70 context_factory_(NULL) { |
| 70 DCHECK(lazy_tls_ptr.Pointer()->Get() == NULL); | 71 DCHECK(lazy_tls_ptr.Pointer()->Get() == NULL); |
| 71 lazy_tls_ptr.Pointer()->Set(this); | 72 lazy_tls_ptr.Pointer()->Set(this); |
| 72 } | 73 } |
| 73 | 74 |
| 74 Env::~Env() { | 75 Env::~Env() { |
| 75 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWillDestroyEnv()); | 76 FOR_EACH_OBSERVER(EnvObserver, observers_, OnWillDestroyEnv()); |
| 76 DCHECK_EQ(this, lazy_tls_ptr.Pointer()->Get()); | 77 DCHECK_EQ(this, lazy_tls_ptr.Pointer()->Get()); |
| 77 lazy_tls_ptr.Pointer()->Set(NULL); | 78 lazy_tls_ptr.Pointer()->Set(NULL); |
| 78 } | 79 } |
| 79 | 80 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { | 114 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { |
| 114 return scoped_ptr<ui::EventTargetIterator>(); | 115 return scoped_ptr<ui::EventTargetIterator>(); |
| 115 } | 116 } |
| 116 | 117 |
| 117 ui::EventTargeter* Env::GetEventTargeter() { | 118 ui::EventTargeter* Env::GetEventTargeter() { |
| 118 NOTREACHED(); | 119 NOTREACHED(); |
| 119 return NULL; | 120 return NULL; |
| 120 } | 121 } |
| 121 | 122 |
| 122 } // namespace aura | 123 } // namespace aura |
| OLD | NEW |