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 <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/common/shelf/shelf_item_delegate.h" | 10 #include "ash/common/shelf/shelf_item_delegate.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 enum Type { | 36 enum Type { |
37 TYPE_APP, | 37 TYPE_APP, |
38 TYPE_APP_PANEL, | 38 TYPE_APP_PANEL, |
39 TYPE_SHORTCUT, | 39 TYPE_SHORTCUT, |
40 TYPE_WINDOWED_APP | 40 TYPE_WINDOWED_APP |
41 }; | 41 }; |
42 | 42 |
43 LauncherItemController(Type type, | 43 LauncherItemController(Type type, |
44 const std::string& app_id, | 44 const std::string& app_id, |
45 const std::string& launch_id, | 45 const std::string& launch_id, |
| 46 const std::string& title, |
46 ChromeLauncherController* launcher_controller); | 47 ChromeLauncherController* launcher_controller); |
47 ~LauncherItemController() override; | 48 ~LauncherItemController() override; |
48 | 49 |
49 Type type() const { return type_; } | 50 Type type() const { return type_; } |
50 ash::ShelfID shelf_id() const { return shelf_id_; } | 51 ash::ShelfID shelf_id() const { return shelf_id_; } |
51 void set_shelf_id(ash::ShelfID id) { shelf_id_ = id; } | 52 void set_shelf_id(ash::ShelfID id) { shelf_id_ = id; } |
52 const std::string& app_id() const { return app_id_; } | 53 const std::string& app_id() const { return app_id_; } |
53 const std::string& launch_id() const { return launch_id_; } | 54 const std::string& launch_id() const { return launch_id_; } |
| 55 const std::string& title() const { return title_; } |
54 ChromeLauncherController* launcher_controller() const { | 56 ChromeLauncherController* launcher_controller() const { |
55 return launcher_controller_; | 57 return launcher_controller_; |
56 } | 58 } |
57 | 59 |
58 // Lock this item to the launcher without being pinned (windowed v1 apps). | 60 // Lock this item to the launcher without being pinned (windowed v1 apps). |
59 void lock() { locked_++; } | 61 void lock() { locked_++; } |
60 void unlock() { | 62 void unlock() { |
61 DCHECK(locked_); | 63 DCHECK(locked_); |
62 locked_--; | 64 locked_--; |
63 } | 65 } |
(...skipping 25 matching lines...) Expand all Loading... |
89 const Type type_; | 91 const Type type_; |
90 | 92 |
91 // The application id; empty if there is no app associated with the item. | 93 // The application id; empty if there is no app associated with the item. |
92 const std::string app_id_; | 94 const std::string app_id_; |
93 | 95 |
94 // An id that can be passed to an app when launched in order to support | 96 // An id that can be passed to an app when launched in order to support |
95 // multiple shelf items per app. This id is used together with the app_id to | 97 // multiple shelf items per app. This id is used together with the app_id to |
96 // uniquely identify each shelf item that has the same app_id. | 98 // uniquely identify each shelf item that has the same app_id. |
97 const std::string launch_id_; | 99 const std::string launch_id_; |
98 | 100 |
| 101 // Title of the window that has its own icon in the shelf. |
| 102 const std::string title_; |
| 103 |
99 // A unique id assigned by the shelf model for the shelf item. | 104 // A unique id assigned by the shelf model for the shelf item. |
100 ash::ShelfID shelf_id_; | 105 ash::ShelfID shelf_id_; |
101 | 106 |
102 ChromeLauncherController* launcher_controller_; | 107 ChromeLauncherController* launcher_controller_; |
103 | 108 |
104 // The lock counter which tells the launcher if the item can be removed from | 109 // The lock counter which tells the launcher if the item can be removed from |
105 // the launcher (0) or not (>0). It is being used for windowed V1 | 110 // the launcher (0) or not (>0). It is being used for windowed V1 |
106 // applications. | 111 // applications. |
107 int locked_; | 112 int locked_; |
108 | 113 |
109 // Set to true if the launcher item image has been set by the controller. | 114 // Set to true if the launcher item image has been set by the controller. |
110 bool image_set_by_controller_; | 115 bool image_set_by_controller_; |
111 | 116 |
112 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); | 117 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); |
113 }; | 118 }; |
114 | 119 |
115 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ | 120 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ |
OLD | NEW |