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

Side by Side Diff: chrome/browser/ui/ash/launcher/browser_status_monitor.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/launcher/browser_status_monitor.h" 5 #include "chrome/browser/ui/ash/launcher/browser_status_monitor.h"
6 6
7 #include "ash/display/window_tree_host_manager.h" 7 #include "ash/display/window_tree_host_manager.h"
8 #include "ash/shelf/shelf_util.h" 8 #include "ash/shelf/shelf_util.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); 121 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows();
122 aura::Window::Windows::const_iterator iter = root_windows.begin(); 122 aura::Window::Windows::const_iterator iter = root_windows.begin();
123 for (; iter != root_windows.end(); ++iter) { 123 for (; iter != root_windows.end(); ++iter) {
124 // |observed_activation_clients_| can have the same activation client 124 // |observed_activation_clients_| can have the same activation client
125 // multiple times - which would be handled by the used 125 // multiple times - which would be handled by the used
126 // |ScopedObserverWithDuplicatedSources|. 126 // |ScopedObserverWithDuplicatedSources|.
127 observed_activation_clients_.Add( 127 observed_activation_clients_.Add(
128 aura::client::GetActivationClient(*iter)); 128 aura::client::GetActivationClient(*iter));
129 observed_root_windows_.Add(static_cast<aura::Window*>(*iter)); 129 observed_root_windows_.Add(static_cast<aura::Window*>(*iter));
130 } 130 }
131 ash::Shell::GetInstance()->GetScreen()->AddObserver(this); 131 gfx::Screen::GetScreen()->AddObserver(this);
132 } 132 }
133 133
134 browser_tab_strip_tracker_.Init( 134 browser_tab_strip_tracker_.Init(
135 BrowserTabStripTracker::InitWith::ALL_BROWERS); 135 BrowserTabStripTracker::InitWith::ALL_BROWERS);
136 } 136 }
137 137
138 BrowserStatusMonitor::~BrowserStatusMonitor() { 138 BrowserStatusMonitor::~BrowserStatusMonitor() {
139 // This check needs for win7_aura. Without this, all tests in 139 // This check needs for win7_aura. Without this, all tests in
140 // ChromeLauncherController will fail in win7_aura. 140 // ChromeLauncherController will fail in win7_aura.
141 if (ash::Shell::HasInstance()) 141 if (ash::Shell::HasInstance())
142 ash::Shell::GetInstance()->GetScreen()->RemoveObserver(this); 142 gfx::Screen::GetScreen()->RemoveObserver(this);
143 143
144 chrome::SettingsWindowManager::GetInstance()->RemoveObserver( 144 chrome::SettingsWindowManager::GetInstance()->RemoveObserver(
145 settings_window_observer_.get()); 145 settings_window_observer_.get());
146 146
147 browser_tab_strip_tracker_.StopObservingAndSendOnBrowserRemoved(); 147 browser_tab_strip_tracker_.StopObservingAndSendOnBrowserRemoved();
148 148
149 STLDeleteContainerPairSecondPointers(webcontents_to_observer_map_.begin(), 149 STLDeleteContainerPairSecondPointers(webcontents_to_observer_map_.begin(),
150 webcontents_to_observer_map_.end()); 150 webcontents_to_observer_map_.end());
151 } 151 }
152 152
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 content::WebContents* contents) { 384 content::WebContents* contents) {
385 return launcher_controller_->GetShelfIDForWebContents(contents); 385 return launcher_controller_->GetShelfIDForWebContents(contents);
386 } 386 }
387 387
388 void BrowserStatusMonitor::SetShelfIDForBrowserWindowContents( 388 void BrowserStatusMonitor::SetShelfIDForBrowserWindowContents(
389 Browser* browser, 389 Browser* browser,
390 content::WebContents* web_contents) { 390 content::WebContents* web_contents) {
391 launcher_controller_->GetBrowserShortcutLauncherItemController()-> 391 launcher_controller_->GetBrowserShortcutLauncherItemController()->
392 SetShelfIDForBrowserWindowContents(browser, web_contents); 392 SetShelfIDForBrowserWindowContents(browser, web_contents);
393 } 393 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698