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 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROLLER
_H_ | 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_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROLLER
_H_ |
7 | 7 |
8 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 8 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 12 matching lines...) Expand all Loading... |
23 class BrowserShortcutLauncherItemController : public LauncherItemController { | 23 class BrowserShortcutLauncherItemController : public LauncherItemController { |
24 public: | 24 public: |
25 BrowserShortcutLauncherItemController(ChromeLauncherController* controller, | 25 BrowserShortcutLauncherItemController(ChromeLauncherController* controller, |
26 Profile* profile); | 26 Profile* profile); |
27 | 27 |
28 virtual ~BrowserShortcutLauncherItemController(); | 28 virtual ~BrowserShortcutLauncherItemController(); |
29 | 29 |
30 // Updates the activation state of the Broswer item. | 30 // Updates the activation state of the Broswer item. |
31 void UpdateBrowserItemState(); | 31 void UpdateBrowserItemState(); |
32 | 32 |
| 33 // Retrieve the list of running applications. |
| 34 ChromeLauncherAppMenuItems GetApplicationList(int event_flags); |
| 35 |
33 // LauncherItemController overrides: | 36 // LauncherItemController overrides: |
34 virtual string16 GetTitle() OVERRIDE; | |
35 virtual bool IsCurrentlyShownInWindow(aura::Window* window) const OVERRIDE; | 37 virtual bool IsCurrentlyShownInWindow(aura::Window* window) const OVERRIDE; |
36 virtual bool IsOpen() const OVERRIDE; | 38 virtual bool IsOpen() const OVERRIDE; |
37 virtual bool IsVisible() const OVERRIDE; | 39 virtual bool IsVisible() const OVERRIDE; |
38 virtual void Launch(int event_flags) OVERRIDE; | 40 virtual void Launch(int event_flags) OVERRIDE; |
39 virtual void Activate() OVERRIDE; | 41 virtual void Activate() OVERRIDE; |
40 virtual void Close() OVERRIDE; | 42 virtual void Close() OVERRIDE; |
41 virtual void Clicked(const ui::Event& event) OVERRIDE; | |
42 virtual void OnRemoved() OVERRIDE; | 43 virtual void OnRemoved() OVERRIDE; |
43 virtual ChromeLauncherAppMenuItems GetApplicationList( | 44 virtual void ItemSelected(const ui::Event& event) OVERRIDE; |
| 45 virtual base::string16 GetTitle() OVERRIDE; |
| 46 virtual ui::MenuModel* CreateContextMenu( |
| 47 aura::RootWindow* root_window) OVERRIDE; |
| 48 virtual ash::LauncherMenuModel* CreateApplicationMenu( |
44 int event_flags) OVERRIDE; | 49 int event_flags) OVERRIDE; |
| 50 virtual bool IsDraggable() OVERRIDE; |
| 51 virtual bool ShouldShowTooltip() OVERRIDE; |
45 | 52 |
46 private: | 53 private: |
47 // Get the favicon for the browser list entry for |web_contents|. | 54 // Get the favicon for the browser list entry for |web_contents|. |
48 // Note that for incognito windows the incognito icon will be returned. | 55 // Note that for incognito windows the incognito icon will be returned. |
49 gfx::Image GetBrowserListIcon(content::WebContents* web_contents) const; | 56 gfx::Image GetBrowserListIcon(content::WebContents* web_contents) const; |
50 | 57 |
51 // Get the title for the browser list entry for |web_contents|. | 58 // Get the title for the browser list entry for |web_contents|. |
52 // If |web_contents| has not loaded, returns "Net Tab". | 59 // If |web_contents| has not loaded, returns "Net Tab". |
53 string16 GetBrowserListTitle(content::WebContents* web_contents) const; | 60 string16 GetBrowserListTitle(content::WebContents* web_contents) const; |
54 | 61 |
55 // Check if the given |web_contents| is in incognito mode. | 62 // Check if the given |web_contents| is in incognito mode. |
56 bool IsIncognito(content::WebContents* web_contents) const; | 63 bool IsIncognito(content::WebContents* web_contents) const; |
57 | 64 |
58 // Activate a browser - or advance to the next one on the list. | 65 // Activate a browser - or advance to the next one on the list. |
59 void ActivateOrAdvanceToNextBrowser(); | 66 void ActivateOrAdvanceToNextBrowser(); |
60 | 67 |
61 // Returns true when the given |browser| is listed in the browser application | 68 // Returns true when the given |browser| is listed in the browser application |
62 // list. | 69 // list. |
63 bool IsBrowserRepresentedInBrowserList(Browser* browser); | 70 bool IsBrowserRepresentedInBrowserList(Browser* browser); |
64 | 71 |
65 Profile* profile_; | 72 Profile* profile_; |
66 | 73 |
67 DISALLOW_COPY_AND_ASSIGN(BrowserShortcutLauncherItemController); | 74 DISALLOW_COPY_AND_ASSIGN(BrowserShortcutLauncherItemController); |
68 }; | 75 }; |
69 | 76 |
70 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROL
LER_H_ | 77 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_BROWSER_SHORTCUT_LAUNCHER_ITEM_CONTROL
LER_H_ |
OLD | NEW |