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

Side by Side Diff: ash/public/cpp/shelf_types.cc

Issue 2833173002: mash: Support ShelfModel access in Chrome. (Closed)
Patch Set: Address comments; fix test failures. Created 3 years, 6 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "ash/public/cpp/shelf_types.h" 5 #include "ash/public/cpp/shelf_types.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 9
10 namespace ash { 10 namespace ash {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // static 61 // static
62 ShelfID ShelfID::Deserialize(const std::string* string) { 62 ShelfID ShelfID::Deserialize(const std::string* string) {
63 if (!string) 63 if (!string)
64 return ShelfID(); 64 return ShelfID();
65 std::vector<std::string> components = base::SplitString( 65 std::vector<std::string> components = base::SplitString(
66 *string, kDelimiter, base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); 66 *string, kDelimiter, base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
67 DCHECK_EQ(2u, components.size()) << "ShelfID serialized incorrectly."; 67 DCHECK_EQ(2u, components.size()) << "ShelfID serialized incorrectly.";
68 return ShelfID(components[0], components[1]); 68 return ShelfID(components[0], components[1]);
69 } 69 }
70 70
71 std::ostream& operator<<(std::ostream& o, const ShelfID& id) {
72 return o << "app_id:" << id.app_id << ", launch_id:" << id.launch_id;
73 }
74
71 } // namespace ash 75 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698