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 "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 virtual void Close() = 0; | 69 virtual void Close() = 0; |
70 | 70 |
71 // Indicates that the item at |index| has changed from its previous value. | 71 // Indicates that the item at |index| has changed from its previous value. |
72 virtual void LauncherItemChanged(int model_index, | 72 virtual void LauncherItemChanged(int model_index, |
73 const ash::LauncherItem& old_item) = 0; | 73 const ash::LauncherItem& old_item) = 0; |
74 | 74 |
75 // Called when the item is clicked. The behavior varies by the number of | 75 // Called when the item is clicked. The behavior varies by the number of |
76 // windows associated with the item: | 76 // windows associated with the item: |
77 // * One window: toggles the minimize state. | 77 // * One window: toggles the minimize state. |
78 // * Multiple windows: cycles the active window. | 78 // * Multiple windows: cycles the active window. |
79 virtual void Clicked() = 0; | 79 // The |event| is dispatched by a view, therefore the type of the |
| 80 // event's target is |views::View|. |
| 81 virtual void Clicked(const ui::Event& event) = 0; |
80 | 82 |
81 // Called when the controlled item is removed from the launcher. | 83 // Called when the controlled item is removed from the launcher. |
82 virtual void OnRemoved() = 0; | 84 virtual void OnRemoved() = 0; |
83 | 85 |
84 // Called to retrieve the list of running applications. | 86 // Called to retrieve the list of running applications. |
85 virtual ChromeLauncherAppMenuItems* GetApplicationList() = 0; | 87 virtual ChromeLauncherAppMenuItems* GetApplicationList() = 0; |
86 | 88 |
87 // Helper function to get the ash::LauncherItemType for the item type. | 89 // Helper function to get the ash::LauncherItemType for the item type. |
88 ash::LauncherItemType GetLauncherItemType() const; | 90 ash::LauncherItemType GetLauncherItemType() const; |
89 | 91 |
90 protected: | 92 protected: |
91 // Helper function to return the title associated with |app_id_|. | 93 // Helper function to return the title associated with |app_id_|. |
92 // Returns an empty title if no matching extension can be found. | 94 // Returns an empty title if no matching extension can be found. |
93 string16 GetAppTitle() const; | 95 string16 GetAppTitle() const; |
94 | 96 |
95 private: | 97 private: |
96 const Type type_; | 98 const Type type_; |
97 // App id will be empty if there is no app associated with the window. | 99 // App id will be empty if there is no app associated with the window. |
98 const std::string app_id_; | 100 const std::string app_id_; |
99 ash::LauncherID launcher_id_; | 101 ash::LauncherID launcher_id_; |
100 ChromeLauncherController* launcher_controller_; | 102 ChromeLauncherController* launcher_controller_; |
101 | 103 |
102 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); | 104 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); |
103 }; | 105 }; |
104 | 106 |
105 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ | 107 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ |
OLD | NEW |