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

Unified Diff: ash/shell.cc

Issue 10960015: aura: Start converting event-filters into event-handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: leak Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.h ('k') | ui/aura/env.h » ('j') | ui/aura/env.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 894961ce87c272a0a36f37a797295c2274415d84..b46cd6b5b3af8390ecddbf40ee83472e9947edec 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -183,7 +183,6 @@ internal::ScreenPositionController*
Shell::Shell(ShellDelegate* delegate)
: screen_(new ScreenAsh),
active_root_window_(NULL),
- env_filter_(NULL),
delegate_(delegate),
#if defined(OS_CHROMEOS)
output_configurator_(new chromeos::OutputConfigurator()),
@@ -361,9 +360,8 @@ void Shell::Init() {
// Launcher, and WallPaper could be created by the factory.
views::FocusManagerFactory::Install(new AshFocusManagerFactory);
- env_filter_ = new aura::shared::CompoundEventFilter;
- // Pass ownership of the filter to the Env.
- aura::Env::GetInstance()->SetEventFilter(env_filter_);
+ env_filter_.reset(new aura::shared::CompoundEventFilter);
+ AddEnvEventFilter(env_filter_.get());
cursor_manager_.set_delegate(this);
@@ -387,20 +385,16 @@ void Shell::Init() {
shell_context_menu_.reset(new internal::ShellContextMenu);
// The order in which event filters are added is significant.
- DCHECK(!GetEnvEventFilterCount());
user_activity_detector_.reset(new UserActivityDetector);
AddEnvEventFilter(user_activity_detector_.get());
- DCHECK_EQ(1U, GetEnvEventFilterCount());
event_rewriter_filter_.reset(new internal::EventRewriterEventFilter);
AddEnvEventFilter(event_rewriter_filter_.get());
- DCHECK_EQ(2U, GetEnvEventFilterCount());
overlay_filter_.reset(new internal::OverlayEventFilter);
AddEnvEventFilter(overlay_filter_.get());
AddShellObserver(overlay_filter_.get());
- DCHECK_EQ(3U, GetEnvEventFilterCount());
input_method_filter_.reset(new aura::shared::InputMethodEventFilter());
AddEnvEventFilter(input_method_filter_.get());
@@ -506,15 +500,11 @@ void Shell::Init() {
}
void Shell::AddEnvEventFilter(aura::EventFilter* filter) {
- env_filter_->AddFilter(filter);
+ aura::Env::GetInstance()->AddPreTargetEventHandler(filter);
}
void Shell::RemoveEnvEventFilter(aura::EventFilter* filter) {
- env_filter_->RemoveFilter(filter);
-}
-
-size_t Shell::GetEnvEventFilterCount() const {
- return env_filter_->GetFilterCount();
+ aura::Env::GetInstance()->RemovePreTargetEventHandler(filter);
}
void Shell::ShowBackgroundMenu(views::Widget* widget,
« no previous file with comments | « ash/shell.h ('k') | ui/aura/env.h » ('j') | ui/aura/env.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698