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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "ui/aura/env_observer.h" | 8 #include "ui/aura/env_observer.h" |
9 #include "ui/aura/root_window_host.h" | 9 #include "ui/aura/root_window_host.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 void Env::AddObserver(EnvObserver* observer) { | 57 void Env::AddObserver(EnvObserver* observer) { |
58 observers_.AddObserver(observer); | 58 observers_.AddObserver(observer); |
59 } | 59 } |
60 | 60 |
61 void Env::RemoveObserver(EnvObserver* observer) { | 61 void Env::RemoveObserver(EnvObserver* observer) { |
62 observers_.RemoveObserver(observer); | 62 observers_.RemoveObserver(observer); |
63 } | 63 } |
64 | 64 |
65 #if !defined(OS_MACOSX) | |
66 base::MessageLoop::Dispatcher* Env::GetDispatcher() { | 65 base::MessageLoop::Dispatcher* Env::GetDispatcher() { |
67 #if defined(USE_X11) | 66 #if defined(USE_X11) |
68 return base::MessagePumpX11::Current(); | 67 return base::MessagePumpX11::Current(); |
69 #else | 68 #else |
70 return dispatcher_.get(); | 69 return dispatcher_.get(); |
71 #endif | 70 #endif |
72 } | 71 } |
73 #endif | |
74 | 72 |
75 void Env::RootWindowActivated(RootWindow* root_window) { | 73 void Env::RootWindowActivated(RootWindow* root_window) { |
76 FOR_EACH_OBSERVER(EnvObserver, observers_, | 74 FOR_EACH_OBSERVER(EnvObserver, observers_, |
77 OnRootWindowActivated(root_window)); | 75 OnRootWindowActivated(root_window)); |
78 } | 76 } |
79 | 77 |
80 //////////////////////////////////////////////////////////////////////////////// | 78 //////////////////////////////////////////////////////////////////////////////// |
81 // Env, private: | 79 // Env, private: |
82 | 80 |
83 void Env::Init() { | 81 void Env::Init() { |
(...skipping 24 matching lines...) Expand all Loading... |
108 | 106 |
109 bool Env::CanAcceptEvent(const ui::Event& event) { | 107 bool Env::CanAcceptEvent(const ui::Event& event) { |
110 return true; | 108 return true; |
111 } | 109 } |
112 | 110 |
113 ui::EventTarget* Env::GetParentTarget() { | 111 ui::EventTarget* Env::GetParentTarget() { |
114 return NULL; | 112 return NULL; |
115 } | 113 } |
116 | 114 |
117 } // namespace aura | 115 } // namespace aura |
OLD | NEW |