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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_
8 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
19 class ChromeLauncherController
;
21 // Item controller for an browser shortcut.
22 class BrowserShortcutLauncherItemController
: public LauncherItemController
{
24 explicit BrowserShortcutLauncherItemController(
25 ChromeLauncherController
* controller
);
27 virtual ~BrowserShortcutLauncherItemController();
29 // Updates the activation state of the Broswer item.
30 void UpdateBrowserItemState();
32 // LauncherItemController overrides:
33 virtual bool IsOpen() const OVERRIDE
;
34 virtual bool IsVisible() const OVERRIDE
;
35 virtual void Launch(ash::LaunchSource source
, int event_flags
) OVERRIDE
;
36 virtual bool Activate(ash::LaunchSource source
) OVERRIDE
;
37 virtual ChromeLauncherAppMenuItems
GetApplicationList(
38 int event_flags
) OVERRIDE
;
39 virtual bool ItemSelected(const ui::Event
& event
) OVERRIDE
;
40 virtual base::string16
GetTitle() OVERRIDE
;
41 virtual ui::MenuModel
* CreateContextMenu(
42 aura::Window
* root_window
) OVERRIDE
;
43 virtual ash::ShelfMenuModel
* CreateApplicationMenu(int event_flags
) OVERRIDE
;
44 virtual bool IsDraggable() OVERRIDE
;
45 virtual bool ShouldShowTooltip() OVERRIDE
;
46 virtual void Close() OVERRIDE
;
49 // Get the favicon for the browser list entry for |web_contents|.
50 // Note that for incognito windows the incognito icon will be returned.
51 gfx::Image
GetBrowserListIcon(content::WebContents
* web_contents
) const;
53 // Get the title for the browser list entry for |web_contents|.
54 // If |web_contents| has not loaded, returns "Net Tab".
55 base::string16
GetBrowserListTitle(content::WebContents
* web_contents
) const;
57 // Check if the given |web_contents| is in incognito mode.
58 bool IsIncognito(content::WebContents
* web_contents
) const;
60 // Activate a browser - or advance to the next one on the list.
61 void ActivateOrAdvanceToNextBrowser();
63 // Returns true when the given |browser| is listed in the browser application
65 bool IsBrowserRepresentedInBrowserList(Browser
* browser
);
67 DISALLOW_COPY_AND_ASSIGN(BrowserShortcutLauncherItemController
);
70 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_