OLD | NEW |
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/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" | 10 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 UpdateBrowserItemState(); | 176 UpdateBrowserItemState(); |
177 } | 177 } |
178 | 178 |
179 void BrowserStatusMonitor::OnDisplayBoundsChanged( | 179 void BrowserStatusMonitor::OnDisplayBoundsChanged( |
180 const gfx::Display& display) { | 180 const gfx::Display& display) { |
181 // Do nothing here. | 181 // Do nothing here. |
182 } | 182 } |
183 | 183 |
184 void BrowserStatusMonitor::OnDisplayAdded(const gfx::Display& new_display) { | 184 void BrowserStatusMonitor::OnDisplayAdded(const gfx::Display& new_display) { |
185 // Add a new RootWindow and its ActivationClient to observed list. | 185 // Add a new RootWindow and its ActivationClient to observed list. |
186 aura::RootWindow* root_window = ash::Shell::GetInstance()-> | 186 aura::Window* root_window = ash::Shell::GetInstance()-> |
187 display_controller()->GetRootWindowForDisplayId(new_display.id()); | 187 display_controller()->GetRootWindowForDisplayId(new_display.id()); |
188 // When the primary root window's display get removed, the existing root | 188 // When the primary root window's display get removed, the existing root |
189 // window is taken over by the new display and the observer is already set. | 189 // window is taken over by the new display and the observer is already set. |
190 if (!observed_root_windows_.IsObserving(root_window)) { | 190 if (!observed_root_windows_.IsObserving(root_window)) { |
191 observed_root_windows_.Add(static_cast<aura::Window*>(root_window)); | 191 observed_root_windows_.Add(static_cast<aura::Window*>(root_window)); |
192 observed_activation_clients_.Add( | 192 observed_activation_clients_.Add( |
193 aura::client::GetActivationClient(root_window)); | 193 aura::client::GetActivationClient(root_window)); |
194 } | 194 } |
195 } | 195 } |
196 | 196 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 } | 281 } |
282 } | 282 } |
283 | 283 |
284 void BrowserStatusMonitor::RemoveWebContentsObserver( | 284 void BrowserStatusMonitor::RemoveWebContentsObserver( |
285 content::WebContents* contents) { | 285 content::WebContents* contents) { |
286 DCHECK(webcontents_to_observer_map_.find(contents) != | 286 DCHECK(webcontents_to_observer_map_.find(contents) != |
287 webcontents_to_observer_map_.end()); | 287 webcontents_to_observer_map_.end()); |
288 delete webcontents_to_observer_map_[contents]; | 288 delete webcontents_to_observer_map_[contents]; |
289 webcontents_to_observer_map_.erase(contents); | 289 webcontents_to_observer_map_.erase(contents); |
290 } | 290 } |
OLD | NEW |