Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Side by Side Diff: ash/public/cpp/shelf_struct_traits.h

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Fix struct traits typo. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/public/cpp/shelf_item_delegate.cc ('k') | ash/public/cpp/shelf_struct_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_STRUCT_TRAITS_H_ 5 #ifndef ASH_PUBLIC_CPP_SHELF_STRUCT_TRAITS_H_
6 #define ASH_PUBLIC_CPP_SHELF_STRUCT_TRAITS_H_ 6 #define ASH_PUBLIC_CPP_SHELF_STRUCT_TRAITS_H_
7 7
8 #include "ash/public/cpp/ash_public_export.h" 8 #include "ash/public/cpp/ash_public_export.h"
9 #include "ash/public/cpp/shelf_item.h" 9 #include "ash/public/cpp/shelf_item.h"
10 #include "ash/public/cpp/shelf_types.h" 10 #include "ash/public/cpp/shelf_types.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 *out = ash::LAUNCH_FROM_APP_LIST_SEARCH; 248 *out = ash::LAUNCH_FROM_APP_LIST_SEARCH;
249 return true; 249 return true;
250 } 250 }
251 NOTREACHED(); 251 NOTREACHED();
252 return false; 252 return false;
253 } 253 }
254 }; 254 };
255 255
256 template <> 256 template <>
257 struct ASH_PUBLIC_EXPORT 257 struct ASH_PUBLIC_EXPORT
258 StructTraits<ash::mojom::ShelfIDDataView, ash::ShelfID> {
259 static const std::string& app_id(const ash::ShelfID& i) { return i.app_id; }
260 static const std::string& launch_id(const ash::ShelfID& i) {
261 return i.launch_id;
262 }
263 static bool Read(ash::mojom::ShelfIDDataView data, ash::ShelfID* out);
264 };
265
266 template <>
267 struct ASH_PUBLIC_EXPORT
258 StructTraits<ash::mojom::ShelfItemDataView, ShelfItem> { 268 StructTraits<ash::mojom::ShelfItemDataView, ShelfItem> {
259 static ash::ShelfItemType type(const ShelfItem& i) { return i.type; } 269 static ash::ShelfItemType type(const ShelfItem& i) { return i.type; }
260 static const SkBitmap& image(const ShelfItem& i); 270 static const SkBitmap& image(const ShelfItem& i);
261 static ash::ShelfID shelf_id(const ShelfItem& i) { return i.id; }
262 static ash::ShelfItemStatus status(const ShelfItem& i) { return i.status; } 271 static ash::ShelfItemStatus status(const ShelfItem& i) { return i.status; }
263 static const std::string& app_id(const ShelfItem& i) { 272 static const ash::ShelfID& shelf_id(const ShelfItem& i) { return i.id; }
264 return i.app_launch_id.app_id();
265 }
266 static const std::string& launch_id(const ShelfItem& i) {
267 return i.app_launch_id.launch_id();
268 }
269 static const base::string16& title(const ShelfItem& i) { return i.title; } 273 static const base::string16& title(const ShelfItem& i) { return i.title; }
270 static bool shows_tooltip(const ShelfItem& i) { return i.shows_tooltip; } 274 static bool shows_tooltip(const ShelfItem& i) { return i.shows_tooltip; }
271 static bool pinned_by_policy(const ShelfItem& i) { 275 static bool pinned_by_policy(const ShelfItem& i) {
272 return i.pinned_by_policy; 276 return i.pinned_by_policy;
273 } 277 }
274 278
275 static bool Read(ash::mojom::ShelfItemDataView data, ShelfItem* out); 279 static bool Read(ash::mojom::ShelfItemDataView data, ShelfItem* out);
276 }; 280 };
277 281
278 } // namespace mojo 282 } // namespace mojo
279 283
280 #endif // ASH_PUBLIC_CPP_SHELF_STRUCT_TRAITS_H_ 284 #endif // ASH_PUBLIC_CPP_SHELF_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « ash/public/cpp/shelf_item_delegate.cc ('k') | ash/public/cpp/shelf_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698