diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 17:35:34 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 17:35:34 +0000 |
commit | 553dfa5181462615f22266838b636d383b5f730f (patch) | |
tree | 37ff80bad3c23e9735a5c5e2072b72cba4077894 /ui/aura/env.cc | |
parent | cccdb792cbe7b444949b87fc981d091dfba8bd96 (diff) | |
download | chromium_src-553dfa5181462615f22266838b636d383b5f730f.zip chromium_src-553dfa5181462615f22266838b636d383b5f730f.tar.gz chromium_src-553dfa5181462615f22266838b636d383b5f730f.tar.bz2 |
Change how you get to the MessageLoop::Dispatcher.
Previously, you would ask the RootWindow (a singleton) for its dispatcher, which was conveniently the RootWindowHost. Now that we are moving towards many RootWindows, you must ask the new singleton, aura::Env, instead.
This CL also implements a dispatcher for windows. It does not implement the Linux one since that's much larger and I'll do that in a followon CL. I just wanted to change the API. Note there is some transitional ugliness.
http://crbug.com/112131
TEST=existing
Review URL: https://chromiumcodereview.appspot.com/9433072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/env.cc')
-rw-r--r-- | ui/aura/env.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/ui/aura/env.cc b/ui/aura/env.cc index e8cee8707..5052e32 100644 --- a/ui/aura/env.cc +++ b/ui/aura/env.cc @@ -4,8 +4,13 @@ #include "ui/aura/env.h" #include "ui/aura/env_observer.h" +#include "ui/aura/root_window_host.h" #include "ui/aura/window.h" +#if !defined(OS_MACOSX) && !defined(OS_WIN) +#include "ui/aura/root_window.h" +#endif + namespace aura { // static @@ -14,7 +19,11 @@ Env* Env::instance_ = NULL; //////////////////////////////////////////////////////////////////////////////// // Env, public: -Env::Env() {} +Env::Env() { +#if defined(OS_WIN) + dispatcher_.reset(CreateDispatcher()); +#endif +} Env::~Env() {} @@ -39,6 +48,18 @@ void Env::RemoveObserver(EnvObserver* observer) { observers_.RemoveObserver(observer); } +#if !defined(OS_MACOSX) +MessageLoop::Dispatcher* Env::GetDispatcher() { +#if defined(OS_WIN) + return dispatcher_.get(); +#else + // TODO(beng): Consolidate in the previous branch of this macro once the linux + // dispatcher is complete. + return RootWindow::GetInstance()->host_->GetDispatcher(); +#endif +} +#endif + //////////////////////////////////////////////////////////////////////////////// // Env, private: |