OLD | NEW |
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 Loading... |
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 |
OLD | NEW |