Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_shortcut_launcher_item_controll er.h" | 5 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll er.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/shelf/shelf_model.h" | 9 #include "ash/shelf/shelf_model.h" |
| 10 #include "ash/shelf/shelf_util.h" | 10 #include "ash/shelf/shelf_util.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 browser->tab_strip_model()->GetActiveWebContents(); | 96 browser->tab_strip_model()->GetActiveWebContents(); |
| 97 if (contents && | 97 if (contents && |
| 98 (launcher_controller()->GetShelfIDForWebContents(contents) != | 98 (launcher_controller()->GetShelfIDForWebContents(contents) != |
| 99 browser_item.id)) | 99 browser_item.id)) |
| 100 browser_status = ash::STATUS_RUNNING; | 100 browser_status = ash::STATUS_RUNNING; |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 if (browser_status == ash::STATUS_CLOSED) { | 104 if (browser_status == ash::STATUS_CLOSED) { |
| 105 const BrowserList* browser_list = BrowserList::GetInstance(); | 105 const BrowserList* browser_list = BrowserList::GetInstance(); |
| 106 for (BrowserList::const_reverse_iterator it = | 106 for (BrowserList::const_iterator it = browser_list->begin(); |
| 107 browser_list->begin_last_active(); | 107 it != browser_list->end() && browser_status == ash::STATUS_CLOSED; |
| 108 it != browser_list->end_last_active() && | |
| 109 browser_status == ash::STATUS_CLOSED; | |
| 110 ++it) { | 108 ++it) { |
|
stevenjb
2016/06/08 20:06:43
As long as we are cleaning this up, can we just us
| |
| 111 if (IsBrowserRepresentedInBrowserList(*it)) | 109 if (IsBrowserRepresentedInBrowserList(*it)) |
| 112 browser_status = ash::STATUS_RUNNING; | 110 browser_status = ash::STATUS_RUNNING; |
| 113 } | 111 } |
| 114 } | 112 } |
| 115 | 113 |
| 116 if (browser_status != browser_item.status) { | 114 if (browser_status != browser_item.status) { |
| 117 browser_item.status = browser_status; | 115 browser_item.status = browser_status; |
| 118 model->Set(browser_index, browser_item); | 116 model->Set(browser_index, browser_item); |
| 119 } | 117 } |
| 120 } | 118 } |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 365 !browser->window()->IsMinimized()) { | 363 !browser->window()->IsMinimized()) { |
| 366 continue; | 364 continue; |
| 367 } | 365 } |
| 368 if (!IsBrowserRepresentedInBrowserList(browser) && | 366 if (!IsBrowserRepresentedInBrowserList(browser) && |
| 369 !browser->is_type_tabbed()) | 367 !browser->is_type_tabbed()) |
| 370 continue; | 368 continue; |
| 371 active_browsers.push_back(browser); | 369 active_browsers.push_back(browser); |
| 372 } | 370 } |
| 373 return active_browsers; | 371 return active_browsers; |
| 374 } | 372 } |
| OLD | NEW |