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

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

Issue 2761373002: Move yet more from WmShell to Shell (Closed)
Patch Set: merge Created 3 years, 9 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 <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/shelf/shelf_delegate.h" 10 #include "ash/common/shelf/shelf_delegate.h"
11 #include "ash/common/shelf/shelf_model.h" 11 #include "ash/common/shelf/shelf_model.h"
12 #include "ash/common/wm_shell.h"
13 #include "ash/common/wm_window.h" 12 #include "ash/common/wm_window.h"
14 #include "ash/resources/grit/ash_resources.h" 13 #include "ash/resources/grit/ash_resources.h"
14 #include "ash/shell.h"
15 #include "ash/wm/window_properties.h" 15 #include "ash/wm/window_properties.h"
16 #include "ash/wm/window_util.h" 16 #include "ash/wm/window_util.h"
17 #include "base/memory/ptr_util.h" 17 #include "base/memory/ptr_util.h"
18 #include "chrome/browser/chrome_notification_types.h" 18 #include "chrome/browser/chrome_notification_types.h"
19 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
21 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h" 21 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h"
22 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" 22 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h"
23 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 23 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
24 #include "chrome/browser/ui/browser.h" 24 #include "chrome/browser/ui/browser.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 return ash::SHELF_ACTION_WINDOW_ACTIVATED; 351 return ash::SHELF_ACTION_WINDOW_ACTIVATED;
352 } 352 }
353 353
354 bool BrowserShortcutLauncherItemController::IsBrowserRepresentedInBrowserList( 354 bool BrowserShortcutLauncherItemController::IsBrowserRepresentedInBrowserList(
355 Browser* browser) { 355 Browser* browser) {
356 // Only Ash desktop browser windows for the active user are represented. 356 // Only Ash desktop browser windows for the active user are represented.
357 if (!browser || !IsBrowserFromActiveUser(browser)) 357 if (!browser || !IsBrowserFromActiveUser(browser))
358 return false; 358 return false;
359 359
360 // v1 App popup windows with a valid app id have their own icon. 360 // v1 App popup windows with a valid app id have their own icon.
361 ash::ShelfDelegate* delegate = ash::WmShell::Get()->shelf_delegate(); 361 ash::ShelfDelegate* delegate = ash::Shell::Get()->shelf_delegate();
362 if (browser->is_app() && browser->is_type_popup() && delegate && 362 if (browser->is_app() && browser->is_type_popup() && delegate &&
363 delegate->GetShelfIDForAppID(web_app::GetExtensionIdFromApplicationName( 363 delegate->GetShelfIDForAppID(web_app::GetExtensionIdFromApplicationName(
364 browser->app_name())) > 0) { 364 browser->app_name())) > 0) {
365 return false; 365 return false;
366 } 366 }
367 367
368 // Settings browsers have their own icon. 368 // Settings browsers have their own icon.
369 if (IsSettingsBrowser(browser)) 369 if (IsSettingsBrowser(browser))
370 return false; 370 return false;
371 371
(...skipping 29 matching lines...) Expand all
401 Browser* browser = content::Source<Browser>(source).ptr(); 401 Browser* browser = content::Source<Browser>(source).ptr();
402 DCHECK(browser); 402 DCHECK(browser);
403 BrowserList::BrowserVector::iterator item = std::find( 403 BrowserList::BrowserVector::iterator item = std::find(
404 browser_menu_items_.begin(), browser_menu_items_.end(), browser); 404 browser_menu_items_.begin(), browser_menu_items_.end(), browser);
405 DCHECK(item != browser_menu_items_.end()); 405 DCHECK(item != browser_menu_items_.end());
406 // Clear the entry for the closed browser and leave other indices intact. 406 // Clear the entry for the closed browser and leave other indices intact.
407 *item = nullptr; 407 *item = nullptr;
408 registrar_.Remove(this, chrome::NOTIFICATION_BROWSER_CLOSING, 408 registrar_.Remove(this, chrome::NOTIFICATION_BROWSER_CLOSING,
409 content::Source<Browser>(browser)); 409 content::Source<Browser>(browser));
410 } 410 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698