Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: ui/aura/env.cc

Issue 962393002: Add TestWebContentsFactory to content/public/test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« ui/aura/env.h ('K') | « ui/aura/env.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 29 matching lines...) Expand all
40 DCHECK(env) << "Env::CreateInstance must be called before getting the " 40 DCHECK(env) << "Env::CreateInstance must be called before getting the "
41 "instance of Env."; 41 "instance of Env.";
42 return env; 42 return env;
43 } 43 }
44 44
45 // static 45 // static
46 void Env::DeleteInstance() { 46 void Env::DeleteInstance() {
47 delete lazy_tls_ptr.Pointer()->Get(); 47 delete lazy_tls_ptr.Pointer()->Get();
48 } 48 }
49 49
50 // static
51 bool Env::HasInstanceForTesting() {
52 return lazy_tls_ptr.Pointer()->Get() != nullptr;
53 }
54
50 void Env::AddObserver(EnvObserver* observer) { 55 void Env::AddObserver(EnvObserver* observer) {
51 observers_.AddObserver(observer); 56 observers_.AddObserver(observer);
52 } 57 }
53 58
54 void Env::RemoveObserver(EnvObserver* observer) { 59 void Env::RemoveObserver(EnvObserver* observer) {
55 observers_.RemoveObserver(observer); 60 observers_.RemoveObserver(observer);
56 } 61 }
57 62
58 bool Env::IsMouseButtonDown() const { 63 bool Env::IsMouseButtonDown() const {
59 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() : 64 return input_state_lookup_.get() ? input_state_lookup_->IsMouseButtonDown() :
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const { 119 scoped_ptr<ui::EventTargetIterator> Env::GetChildIterator() const {
115 return nullptr; 120 return nullptr;
116 } 121 }
117 122
118 ui::EventTargeter* Env::GetEventTargeter() { 123 ui::EventTargeter* Env::GetEventTargeter() {
119 NOTREACHED(); 124 NOTREACHED();
120 return NULL; 125 return NULL;
121 } 126 }
122 127
123 } // namespace aura 128 } // namespace aura
OLDNEW
« ui/aura/env.h ('K') | « ui/aura/env.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698