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

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

Issue 2290603002: Enhance chrome.app.window API for shelf integration with pinning support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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
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/common/shelf/shelf_delegate.h" 9 #include "ash/common/shelf/shelf_delegate.h"
10 #include "ash/common/shelf/shelf_model.h" 10 #include "ash/common/shelf/shelf_model.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 bool BrowserShortcutLauncherItemController::IsBrowserRepresentedInBrowserList( 329 bool BrowserShortcutLauncherItemController::IsBrowserRepresentedInBrowserList(
330 Browser* browser) { 330 Browser* browser) {
331 // Only Ash desktop browser windows for the active user are represented. 331 // Only Ash desktop browser windows for the active user are represented.
332 if (!browser || !IsBrowserFromActiveUser(browser)) 332 if (!browser || !IsBrowserFromActiveUser(browser))
333 return false; 333 return false;
334 334
335 // v1 App popup windows with a valid app id have their own icon. 335 // v1 App popup windows with a valid app id have their own icon.
336 if (browser->is_app() && browser->is_type_popup() && 336 if (browser->is_app() && browser->is_type_popup() &&
337 ash::WmShell::Get()->shelf_delegate()->GetShelfIDForAppID( 337 ash::WmShell::Get()->shelf_delegate()->GetShelfIDForAppID(
338 web_app::GetExtensionIdFromApplicationName(browser->app_name()),
338 web_app::GetExtensionIdFromApplicationName(browser->app_name())) > 0) 339 web_app::GetExtensionIdFromApplicationName(browser->app_name())) > 0)
339 return false; 340 return false;
340 341
341 // Settings browsers have their own icon. 342 // Settings browsers have their own icon.
342 if (IsSettingsBrowser(browser)) 343 if (IsSettingsBrowser(browser))
343 return false; 344 return false;
344 345
345 // Tabbed browser and other popup windows are all represented. 346 // Tabbed browser and other popup windows are all represented.
346 return true; 347 return true;
347 } 348 }
(...skipping 10 matching lines...) Expand all
358 !browser->window()->IsMinimized()) { 359 !browser->window()->IsMinimized()) {
359 continue; 360 continue;
360 } 361 }
361 if (!IsBrowserRepresentedInBrowserList(browser) && 362 if (!IsBrowserRepresentedInBrowserList(browser) &&
362 !browser->is_type_tabbed()) 363 !browser->is_type_tabbed())
363 continue; 364 continue;
364 active_browsers.push_back(browser); 365 active_browsers.push_back(browser);
365 } 366 }
366 return active_browsers; 367 return active_browsers;
367 } 368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698