| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |