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

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

Issue 2051503002: Fix restore windows chrome icon has no running status bar on shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using c++11 range iterator Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 content::WebContents* contents = 95 content::WebContents* contents =
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 for (auto* browser : *BrowserList::GetInstance()) {
106 for (BrowserList::const_reverse_iterator it = 106 if (IsBrowserRepresentedInBrowserList(browser)) {
107 browser_list->begin_last_active();
108 it != browser_list->end_last_active() &&
109 browser_status == ash::STATUS_CLOSED;
110 ++it) {
111 if (IsBrowserRepresentedInBrowserList(*it))
112 browser_status = ash::STATUS_RUNNING; 107 browser_status = ash::STATUS_RUNNING;
108 break;
109 }
113 } 110 }
114 } 111 }
115 112
116 if (browser_status != browser_item.status) { 113 if (browser_status != browser_item.status) {
117 browser_item.status = browser_status; 114 browser_item.status = browser_status;
118 model->Set(browser_index, browser_item); 115 model->Set(browser_index, browser_item);
119 } 116 }
120 } 117 }
121 118
122 void BrowserShortcutLauncherItemController::SetShelfIDForBrowserWindowContents( 119 void BrowserShortcutLauncherItemController::SetShelfIDForBrowserWindowContents(
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 !browser->window()->IsMinimized()) { 362 !browser->window()->IsMinimized()) {
366 continue; 363 continue;
367 } 364 }
368 if (!IsBrowserRepresentedInBrowserList(browser) && 365 if (!IsBrowserRepresentedInBrowserList(browser) &&
369 !browser->is_type_tabbed()) 366 !browser->is_type_tabbed())
370 continue; 367 continue;
371 active_browsers.push_back(browser); 368 active_browsers.push_back(browser);
372 } 369 }
373 return active_browsers; 370 return active_browsers;
374 } 371 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698