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_LAUNCHER_ITEM_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ |
7 | 7 |
8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
9 #include "ash/shelf/shelf_item_delegate.h" | 9 #include "ash/shelf/shelf_item_delegate.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 virtual bool IsVisible() const = 0; | 71 virtual bool IsVisible() const = 0; |
72 | 72 |
73 // Launches a new instance of the app associated with this item. | 73 // Launches a new instance of the app associated with this item. |
74 virtual void Launch(ash::LaunchSource source, int event_flags) = 0; | 74 virtual void Launch(ash::LaunchSource source, int event_flags) = 0; |
75 | 75 |
76 // Shows and activates the most-recently-active window associated with the | 76 // Shows and activates the most-recently-active window associated with the |
77 // item, or launches the item if it is not currently open. | 77 // item, or launches the item if it is not currently open. |
78 // Returns true when a new item got created. | 78 // Returns true when a new item got created. |
79 virtual bool Activate(ash::LaunchSource source) = 0; | 79 virtual bool Activate(ash::LaunchSource source) = 0; |
80 | 80 |
81 // Closes all windows associated with this item. | |
82 virtual void Close() = 0; | |
83 | |
84 // Called to retrieve the list of running applications. | 81 // Called to retrieve the list of running applications. |
85 virtual ChromeLauncherAppMenuItems GetApplicationList(int event_flags) = 0; | 82 virtual ChromeLauncherAppMenuItems GetApplicationList(int event_flags) = 0; |
86 | 83 |
87 // Helper function to get the ash::LauncherItemType for the item type. | 84 // Helper function to get the ash::LauncherItemType for the item type. |
88 ash::LauncherItemType GetLauncherItemType() const; | 85 ash::LauncherItemType GetLauncherItemType() const; |
89 | 86 |
90 protected: | 87 protected: |
91 // Helper function to return the title associated with |app_id_|. | 88 // Helper function to return the title associated with |app_id_|. |
92 // Returns an empty title if no matching extension can be found. | 89 // Returns an empty title if no matching extension can be found. |
93 base::string16 GetAppTitle() const; | 90 base::string16 GetAppTitle() const; |
(...skipping 10 matching lines...) Expand all Loading... |
104 // applications. | 101 // applications. |
105 int locked_; | 102 int locked_; |
106 | 103 |
107 // Set to true if the launcher item image has been set by the controller. | 104 // Set to true if the launcher item image has been set by the controller. |
108 bool image_set_by_controller_; | 105 bool image_set_by_controller_; |
109 | 106 |
110 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); | 107 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); |
111 }; | 108 }; |
112 | 109 |
113 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ | 110 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ |
OLD | NEW |