OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 class ChromeLauncherController; | 25 class ChromeLauncherController; |
26 | 26 |
27 // Item controller for an app shortcut. Shortcuts track app and launcher ids, | 27 // Item controller for an app shortcut. Shortcuts track app and launcher ids, |
28 // but do not have any associated windows (opening a shortcut will replace the | 28 // but do not have any associated windows (opening a shortcut will replace the |
29 // item with the appropriate LauncherItemController type). | 29 // item with the appropriate LauncherItemController type). |
30 class AppShortcutLauncherItemController : public LauncherItemController { | 30 class AppShortcutLauncherItemController : public LauncherItemController { |
31 public: | 31 public: |
32 AppShortcutLauncherItemController(const std::string& app_id, | 32 AppShortcutLauncherItemController(const std::string& app_id, |
33 ChromeLauncherController* controller); | 33 ChromeLauncherController* controller); |
34 | 34 |
35 virtual ~AppShortcutLauncherItemController(); | 35 ~AppShortcutLauncherItemController() override; |
36 | 36 |
37 std::vector<content::WebContents*> GetRunningApplications(); | 37 std::vector<content::WebContents*> GetRunningApplications(); |
38 | 38 |
39 // LauncherItemController overrides: | 39 // LauncherItemController overrides: |
40 virtual bool IsOpen() const override; | 40 bool IsOpen() const override; |
41 virtual bool IsVisible() const override; | 41 bool IsVisible() const override; |
42 virtual void Launch(ash::LaunchSource source, int event_flags) override; | 42 void Launch(ash::LaunchSource source, int event_flags) override; |
43 virtual bool Activate(ash::LaunchSource source) override; | 43 bool Activate(ash::LaunchSource source) override; |
44 virtual ChromeLauncherAppMenuItems GetApplicationList( | 44 ChromeLauncherAppMenuItems GetApplicationList(int event_flags) override; |
45 int event_flags) override; | 45 bool ItemSelected(const ui::Event& event) override; |
46 virtual bool ItemSelected(const ui::Event& event) override; | 46 base::string16 GetTitle() override; |
47 virtual base::string16 GetTitle() override; | 47 ui::MenuModel* CreateContextMenu(aura::Window* root_window) override; |
48 virtual ui::MenuModel* CreateContextMenu( | 48 ash::ShelfMenuModel* CreateApplicationMenu(int event_flags) override; |
49 aura::Window* root_window) override; | 49 bool IsDraggable() override; |
50 virtual ash::ShelfMenuModel* CreateApplicationMenu(int event_flags) override; | 50 bool ShouldShowTooltip() override; |
51 virtual bool IsDraggable() override; | 51 void Close() override; |
52 virtual bool ShouldShowTooltip() override; | |
53 virtual void Close() override; | |
54 | 52 |
55 // Get the refocus url pattern, which can be used to identify this application | 53 // Get the refocus url pattern, which can be used to identify this application |
56 // from a URL link. | 54 // from a URL link. |
57 const GURL& refocus_url() const { return refocus_url_; } | 55 const GURL& refocus_url() const { return refocus_url_; } |
58 // Set the refocus url pattern. Used by unit tests. | 56 // Set the refocus url pattern. Used by unit tests. |
59 void set_refocus_url(const GURL& refocus_url) { refocus_url_ = refocus_url; } | 57 void set_refocus_url(const GURL& refocus_url) { refocus_url_ = refocus_url; } |
60 | 58 |
61 private: | 59 private: |
62 // Get the last running application. | 60 // Get the last running application. |
63 content::WebContents* GetLRUApplication(); | 61 content::WebContents* GetLRUApplication(); |
(...skipping 26 matching lines...) Expand all Loading... |
90 // Since V2 applications can be undetectable after launching, this timer is | 88 // Since V2 applications can be undetectable after launching, this timer is |
91 // keeping track of the last launch attempt. | 89 // keeping track of the last launch attempt. |
92 base::Time last_launch_attempt_; | 90 base::Time last_launch_attempt_; |
93 | 91 |
94 ChromeLauncherController* chrome_launcher_controller_; | 92 ChromeLauncherController* chrome_launcher_controller_; |
95 | 93 |
96 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); | 94 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); |
97 }; | 95 }; |
98 | 96 |
99 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_
H_ | 97 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_
H_ |
OLD | NEW |