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

Unified Diff: trunk/src/chrome/browser/ui/ash/launcher/browser_status_monitor.cc

Issue 23538010: Revert 222124 "Makes BrowserStatusMonitor remove observers in de..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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 | « trunk/src/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
===================================================================
--- trunk/src/chrome/browser/ui/ash/launcher/browser_status_monitor.cc (revision 222137)
+++ trunk/src/chrome/browser/ui/ash/launcher/browser_status_monitor.cc (working copy)
@@ -27,8 +27,11 @@
observed_activation_clients_(this),
observed_root_windows_(this) {
DCHECK(launcher_controller_);
- BrowserList::AddObserver(this);
+ BrowserList* browser_list =
+ BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
+ browser_list->AddObserver(this);
+
// This check needs for win7_aura. Without this, all tests in
// ChromeLauncherController will fail in win7_aura.
if (ash::Shell::HasInstance()) {
@@ -54,14 +57,10 @@
if (ash::Shell::HasInstance())
ash::Shell::GetInstance()->GetScreen()->RemoveObserver(this);
- BrowserList::RemoveObserver(this);
-
BrowserList* browser_list =
BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
- for (BrowserList::const_iterator i = browser_list->begin();
- i != browser_list->end(); ++i) {
- OnBrowserRemoved(*i);
- }
+
+ browser_list->RemoveObserver(this);
}
void BrowserStatusMonitor::OnWindowActivated(aura::Window* gained_active,
@@ -87,9 +86,6 @@
}
void BrowserStatusMonitor::OnBrowserAdded(Browser* browser) {
- if (browser->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH)
- return;
-
browser->tab_strip_model()->AddObserver(this);
if (browser->is_type_popup() && browser->is_app()) {
@@ -103,9 +99,6 @@
}
void BrowserStatusMonitor::OnBrowserRemoved(Browser* browser) {
- if (browser->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH)
- return;
-
browser->tab_strip_model()->RemoveObserver(this);
if (browser_to_app_id_map_.find(browser) != browser_to_app_id_map_.end()) {
@@ -148,9 +141,6 @@
if (old_contents)
browser = chrome::FindBrowserWithWebContents(old_contents);
- if (browser && browser->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH)
- return;
-
// Update immediately on a tab change.
if (browser &&
(TabStripModel::kNoTab !=
@@ -200,9 +190,6 @@
ChromeLauncherController::APP_STATE_INACTIVE;
Browser* browser = chrome::FindBrowserWithWebContents(contents);
- DCHECK(browser);
- if (browser->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH)
- return;
if (browser->tab_strip_model()->GetActiveWebContents() == contents) {
if (browser->window()->IsActive())
app_state = ChromeLauncherController::APP_STATE_WINDOW_ACTIVE;
« no previous file with comments | « trunk/src/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698