| 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/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/shelf/shelf_item_types.h" | 8 #include "ash/common/shelf/shelf_item_types.h" |
| 9 #include "ash/common/wm_window_property.h" | 9 #include "ash/common/wm_window_property.h" |
| 10 #include "ash/resources/grit/ash_resources.h" | 10 #include "ash/resources/grit/ash_resources.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 state = ChromeLauncherController::APP_STATE_WINDOW_ACTIVE; | 249 state = ChromeLauncherController::APP_STATE_WINDOW_ACTIVE; |
| 250 UpdateAppItemState(new_contents, state); | 250 UpdateAppItemState(new_contents, state); |
| 251 UpdateBrowserItemState(); | 251 UpdateBrowserItemState(); |
| 252 | 252 |
| 253 if (tab_strip_model->GetActiveWebContents() == new_contents) | 253 if (tab_strip_model->GetActiveWebContents() == new_contents) |
| 254 SetShelfIDForBrowserWindowContents(browser, new_contents); | 254 SetShelfIDForBrowserWindowContents(browser, new_contents); |
| 255 | 255 |
| 256 AddWebContentsObserver(new_contents); | 256 AddWebContentsObserver(new_contents); |
| 257 } | 257 } |
| 258 | 258 |
| 259 void BrowserStatusMonitor::TabInsertedAt(content::WebContents* contents, | 259 void BrowserStatusMonitor::TabInsertedAt(TabStripModel* tab_strip_model, |
| 260 content::WebContents* contents, |
| 260 int index, | 261 int index, |
| 261 bool foreground) { | 262 bool foreground) { |
| 262 // An inserted tab is not active - ActiveTabChanged() will be called to | 263 // An inserted tab is not active - ActiveTabChanged() will be called to |
| 263 // activate. We initialize therefore with |APP_STATE_INACTIVE|. | 264 // activate. We initialize therefore with |APP_STATE_INACTIVE|. |
| 264 UpdateAppItemState(contents, | 265 UpdateAppItemState(contents, |
| 265 ChromeLauncherController::APP_STATE_INACTIVE); | 266 ChromeLauncherController::APP_STATE_INACTIVE); |
| 266 AddWebContentsObserver(contents); | 267 AddWebContentsObserver(contents); |
| 267 } | 268 } |
| 268 | 269 |
| 269 void BrowserStatusMonitor::TabClosingAt(TabStripModel* tab_strip_mode, | 270 void BrowserStatusMonitor::TabClosingAt(TabStripModel* tab_strip_mode, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 content::WebContents* contents) { | 326 content::WebContents* contents) { |
| 326 return launcher_controller_->GetShelfIDForWebContents(contents); | 327 return launcher_controller_->GetShelfIDForWebContents(contents); |
| 327 } | 328 } |
| 328 | 329 |
| 329 void BrowserStatusMonitor::SetShelfIDForBrowserWindowContents( | 330 void BrowserStatusMonitor::SetShelfIDForBrowserWindowContents( |
| 330 Browser* browser, | 331 Browser* browser, |
| 331 content::WebContents* web_contents) { | 332 content::WebContents* web_contents) { |
| 332 launcher_controller_->GetBrowserShortcutLauncherItemController()-> | 333 launcher_controller_->GetBrowserShortcutLauncherItemController()-> |
| 333 SetShelfIDForBrowserWindowContents(browser, web_contents); | 334 SetShelfIDForBrowserWindowContents(browser, web_contents); |
| 334 } | 335 } |
| OLD | NEW |