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 ASH_PUBLIC_CPP_SHELF_TYPES_H_ | 5 #ifndef ASH_PUBLIC_CPP_SHELF_TYPES_H_ |
6 #define ASH_PUBLIC_CPP_SHELF_TYPES_H_ | 6 #define ASH_PUBLIC_CPP_SHELF_TYPES_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <string> | |
9 | 10 |
10 #include "ash/public/cpp/app_launch_id.h" | |
11 #include "ash/public/cpp/ash_public_export.h" | 11 #include "ash/public/cpp/ash_public_export.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 enum ShelfAlignment { | 15 enum ShelfAlignment { |
16 SHELF_ALIGNMENT_BOTTOM, | 16 SHELF_ALIGNMENT_BOTTOM, |
17 SHELF_ALIGNMENT_LEFT, | 17 SHELF_ALIGNMENT_LEFT, |
18 SHELF_ALIGNMENT_RIGHT, | 18 SHELF_ALIGNMENT_RIGHT, |
19 // Top has never been supported. | 19 // Top has never been supported. |
20 | 20 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 // An existing inactive window was activated. | 83 // An existing inactive window was activated. |
84 SHELF_ACTION_WINDOW_ACTIVATED, | 84 SHELF_ACTION_WINDOW_ACTIVATED, |
85 | 85 |
86 // The currently active window was minimized. | 86 // The currently active window was minimized. |
87 SHELF_ACTION_WINDOW_MINIMIZED, | 87 SHELF_ACTION_WINDOW_MINIMIZED, |
88 | 88 |
89 // The app list launcher menu was shown. | 89 // The app list launcher menu was shown. |
90 SHELF_ACTION_APP_LIST_SHOWN, | 90 SHELF_ACTION_APP_LIST_SHOWN, |
91 }; | 91 }; |
92 | 92 |
93 // TODO(msw): Rename AppLaunchId to ShelfID. | |
94 using ShelfID = AppLaunchId; | |
95 | |
96 // The type of a shelf item. | 93 // The type of a shelf item. |
97 enum ShelfItemType { | 94 enum ShelfItemType { |
98 // Represents a running app panel. | 95 // Represents a running app panel. |
99 TYPE_APP_PANEL, | 96 TYPE_APP_PANEL, |
100 | 97 |
101 // Represents a pinned shortcut to an app, the app may be running or not. | 98 // Represents a pinned shortcut to an app, the app may be running or not. |
102 TYPE_PINNED_APP, | 99 TYPE_PINNED_APP, |
103 | 100 |
104 // Toggles visiblity of the app list. | 101 // Toggles visiblity of the app list. |
105 TYPE_APP_LIST, | 102 TYPE_APP_LIST, |
(...skipping 22 matching lines...) Expand all Loading... | |
128 // A closed shelf item, i.e. has no live instance. | 125 // A closed shelf item, i.e. has no live instance. |
129 STATUS_CLOSED, | 126 STATUS_CLOSED, |
130 // A shelf item that has live instance. | 127 // A shelf item that has live instance. |
131 STATUS_RUNNING, | 128 STATUS_RUNNING, |
132 // An active shelf item that has focus. | 129 // An active shelf item that has focus. |
133 STATUS_ACTIVE, | 130 STATUS_ACTIVE, |
134 // A shelf item that needs user's attention. | 131 // A shelf item that needs user's attention. |
135 STATUS_ATTENTION, | 132 STATUS_ATTENTION, |
136 }; | 133 }; |
137 | 134 |
135 // A unique shelf item id composed of an |app_id| and a |launch_id|. | |
136 // |app_id| is the non-empty application id associated with a set of windows. | |
137 // |launch_id| is passed on app launch, to support multiple shelf items per app. | |
138 // As an example, a remote desktop client may want each remote application to | |
139 // have its own icon. | |
140 struct ASH_PUBLIC_EXPORT ShelfID { | |
141 ShelfID(const std::string& app_id, const std::string& launch_id); | |
sky
2017/05/05 22:54:40
optional: use default value for launch_id and get
msw
2017/05/05 23:17:48
Good call, I made both optional and nixed the othe
| |
142 // Creates an ShelfID with an empty |launch_id|. | |
143 explicit ShelfID(const std::string& app_id); | |
144 // Empty constructor for pre-allocating. | |
145 ShelfID(); | |
146 ~ShelfID(); | |
147 | |
148 ShelfID(const ShelfID& other); | |
149 ShelfID(ShelfID&& other); | |
150 ShelfID& operator=(const ShelfID& other); | |
151 bool operator==(const ShelfID& other) const; | |
152 bool operator!=(const ShelfID& other) const; | |
153 bool operator<(const ShelfID& other) const; | |
154 | |
155 // Returns true if both the application id and launch id are empty. | |
156 // This is often used to determine if the id is invalid. | |
157 bool IsNull() const; | |
158 | |
159 // The application id associated with a set of windows. | |
160 std::string app_id; | |
161 // An id passed on app launch, to support multiple shelf items per app. | |
162 std::string launch_id; | |
163 }; | |
164 | |
138 } // namespace ash | 165 } // namespace ash |
139 | 166 |
140 #endif // ASH_PUBLIC_CPP_SHELF_TYPES_H_ | 167 #endif // ASH_PUBLIC_CPP_SHELF_TYPES_H_ |
OLD | NEW |