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

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: fix unittest failure 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
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