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

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

Issue 12262019: Replace static/native-desktop-only BrowserList::const_reverse_iterator by desktop specific ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: chrome_launcher_controller_per_app_unittest should be creating browsers on the ash desktop Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_launcher_controller_per_app.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/launcher/launcher_model.h" 9 #include "ash/launcher/launcher_model.h"
10 #include "ash/launcher/launcher_util.h" 10 #include "ash/launcher/launcher_util.h"
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 } 1364 }
1365 1365
1366 ChromeLauncherAppMenuItems 1366 ChromeLauncherAppMenuItems
1367 ChromeLauncherControllerPerApp::GetBrowserApplicationList() { 1367 ChromeLauncherControllerPerApp::GetBrowserApplicationList() {
1368 ChromeLauncherAppMenuItems items; 1368 ChromeLauncherAppMenuItems items;
1369 bool found_tabbed_browser = false; 1369 bool found_tabbed_browser = false;
1370 // Add the application name to the menu. 1370 // Add the application name to the menu.
1371 items.push_back(new ChromeLauncherAppMenuItem( 1371 items.push_back(new ChromeLauncherAppMenuItem(
1372 l10n_util::GetStringFUTF16(IDS_LAUNCHER_CHROME_BROWSER_NAME, 1372 l10n_util::GetStringFUTF16(IDS_LAUNCHER_CHROME_BROWSER_NAME,
1373 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), NULL)); 1373 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), NULL));
1374 const chrome::BrowserListImpl* ash_browser_list =
1375 chrome::BrowserListImpl::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
1374 int index = 1; 1376 int index = 1;
1375 for (BrowserList::const_reverse_iterator it = 1377 for (chrome::BrowserListImpl::const_reverse_iterator it =
1376 BrowserList::begin_last_active(); 1378 ash_browser_list->begin_last_active();
1377 it != BrowserList::end_last_active(); ++it, ++index) { 1379 it != ash_browser_list->end_last_active(); ++it, ++index) {
1378 Browser* browser = *it; 1380 Browser* browser = *it;
1379 if (browser->is_type_tabbed()) 1381 if (browser->is_type_tabbed())
1380 found_tabbed_browser = true; 1382 found_tabbed_browser = true;
1381 TabStripModel* tab_strip = browser->tab_strip_model(); 1383 TabStripModel* tab_strip = browser->tab_strip_model();
1382 WebContents* web_contents = 1384 WebContents* web_contents =
1383 tab_strip->GetWebContentsAt(tab_strip->active_index()); 1385 tab_strip->GetWebContentsAt(tab_strip->active_index());
1384 gfx::Image app_icon = GetAppListIcon(web_contents); 1386 gfx::Image app_icon = GetAppListIcon(web_contents);
1385 items.push_back(new ChromeLauncherAppMenuItemBrowser( 1387 items.push_back(new ChromeLauncherAppMenuItemBrowser(
1386 web_contents->GetTitle(), 1388 web_contents->GetTitle(),
1387 app_icon.IsEmpty() ? NULL : &app_icon, 1389 app_icon.IsEmpty() ? NULL : &app_icon,
1388 browser)); 1390 browser));
1389 } 1391 }
1390 // If only windowed applications are open, we return an empty list to 1392 // If only windowed applications are open, we return an empty list to
1391 // enforce the creation of a new browser. 1393 // enforce the creation of a new browser.
1392 if (!found_tabbed_browser) 1394 if (!found_tabbed_browser)
1393 items.clear(); 1395 items.clear();
1394 return items.Pass(); 1396 return items.Pass();
1395 } 1397 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698