| OLD | NEW |
| 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 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" | 5 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" |
| 6 | 6 |
| 7 #include "base/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "components/crx_file/id_util.h" | 10 #include "components/crx_file/id_util.h" |
| 11 | 11 |
| 12 namespace arc { | 12 namespace arc { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // String representation of Intent starts with this prefix. | 16 // String representation of Intent starts with this prefix. |
| 17 constexpr char kIntent[] = "#Intent"; | 17 constexpr char kIntent[] = "#Intent"; |
| 18 // Prefix in intent that specifies Arc shelf group. S. means string type. | 18 // Prefix in intent that specifies ARC shelf group. S. means string type. |
| 19 constexpr char kShelfGroupIntentPrefix[] = "S.org.chromium.arc.shelf_group_id="; | 19 constexpr char kShelfGroupIntentPrefix[] = "S.org.chromium.arc.shelf_group_id="; |
| 20 // Prefix to specify Arc shelf group. | 20 // Prefix to specify ARC shelf group. |
| 21 constexpr char kShelfGroupPrefix[] = "shelf_group:"; | 21 constexpr char kShelfGroupPrefix[] = "shelf_group:"; |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 ArcAppShelfId::ArcAppShelfId(const std::string& shelf_group_id, | 25 ArcAppShelfId::ArcAppShelfId(const std::string& shelf_group_id, |
| 26 const std::string& app_id) | 26 const std::string& app_id) |
| 27 : shelf_group_id_(shelf_group_id), app_id_(app_id) { | 27 : shelf_group_id_(shelf_group_id), app_id_(app_id) { |
| 28 DCHECK(crx_file::id_util::IdIsValid(app_id)); | 28 DCHECK(crx_file::id_util::IdIsValid(app_id)); |
| 29 } | 29 } |
| 30 | 30 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool ArcAppShelfId::operator<(const ArcAppShelfId& other) const { | 75 bool ArcAppShelfId::operator<(const ArcAppShelfId& other) const { |
| 76 const int compare_group = shelf_group_id_.compare(other.shelf_group_id()); | 76 const int compare_group = shelf_group_id_.compare(other.shelf_group_id()); |
| 77 if (compare_group == 0) | 77 if (compare_group == 0) |
| 78 return app_id_ < other.app_id(); | 78 return app_id_ < other.app_id(); |
| 79 return compare_group < 0; | 79 return compare_group < 0; |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace arc | 82 } // namespace arc |
| OLD | NEW |