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

Unified Diff: chrome/browser/chromeos/events/event_rewriter_controller.cc

Issue 283803002: Add EventRewriterController as an aura::Env observer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/events/event_rewriter_controller.cc
diff --git a/chrome/browser/chromeos/events/event_rewriter_controller.cc b/chrome/browser/chromeos/events/event_rewriter_controller.cc
index 8b3cc5b40c8342b16b5f3756788f52cafe8c83ae..a22d8e716edfe18c845f5d7d684f28818e181721 100644
--- a/chrome/browser/chromeos/events/event_rewriter_controller.cc
+++ b/chrome/browser/chromeos/events/event_rewriter_controller.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/events/event_rewriter_controller.h"
#include "ash/shell.h"
+#include "ui/aura/env.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/event_source.h"
@@ -14,6 +15,7 @@ EventRewriterController::EventRewriterController() : initialized_(false) {
}
EventRewriterController::~EventRewriterController() {
+ aura::Env::GetInstance()->RemoveObserver(this);
// Remove the rewriters from every root window EventSource and destroy them.
for (EventRewriters::iterator rewriter_iter = rewriters_.begin();
rewriter_iter != rewriters_.end();
@@ -45,6 +47,8 @@ void EventRewriterController::Init() {
++it) {
AddToEventSource((*it)->GetHost()->GetEventSource());
}
+ // Add the controller as an observer for new root windows.
+ aura::Env::GetInstance()->AddObserver(this);
Daniel Erat 2014/05/13 15:27:31 can you do this in the c'tor instead? the add/remo
}
void EventRewriterController::OnHostInitialized(aura::WindowTreeHost* host) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698