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

Unified Diff: ui/aura/desktop/desktop_activation_client.cc

Issue 11062004: Fix crash in a few of the tests in content_browsertests on Linux. The problem was that DesktopActiv… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: actually need to use test compositor on bots Created 8 years, 2 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
« base/scoped_observer.h ('K') | « ui/aura/desktop/desktop_activation_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/desktop/desktop_activation_client.cc
===================================================================
--- ui/aura/desktop/desktop_activation_client.cc (revision 159993)
+++ ui/aura/desktop/desktop_activation_client.cc (working copy)
@@ -8,7 +8,6 @@
#include "base/compiler_specific.h"
#include "ui/aura/client/activation_delegate.h"
#include "ui/aura/client/activation_change_observer.h"
-#include "ui/aura/env.h"
#include "ui/aura/focus_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -31,13 +30,11 @@
current_active_(NULL),
updating_activation_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(observer_manager_(this)) {
- aura::Env::GetInstance()->AddObserver(this);
focus_manager->AddObserver(this);
}
DesktopActivationClient::~DesktopActivationClient() {
focus_manager_->RemoveObserver(this);
- aura::Env::GetInstance()->RemoveObserver(this);
}
void DesktopActivationClient::AddObserver(
@@ -72,6 +69,9 @@
aura::Window* old_active = current_active_;
current_active_ = window;
+ if (window && !observer_manager_.IsObserving(window))
+ observer_manager_.Add(window);
+
FOR_EACH_OBSERVER(client::ActivationChangeObserver,
observers_,
OnWindowActivated(window, old_active));
@@ -114,10 +114,6 @@
observer_manager_.Remove(window);
}
-void DesktopActivationClient::OnWindowInitialized(aura::Window* window) {
- observer_manager_.Add(window);
-}
-
void DesktopActivationClient::OnWindowFocused(aura::Window* window) {
ActivateWindow(GetActivatableWindow(window));
}
« base/scoped_observer.h ('K') | « ui/aura/desktop/desktop_activation_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698