OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/common/manifest_handlers/kiosk_mode_info.h" | 5 #include "extensions/common/manifest_handlers/kiosk_mode_info.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 std::vector<std::string> ids; | 107 std::vector<std::string> ids; |
108 if (manifest->HasKey(keys::kKioskSecondaryApps)) { | 108 if (manifest->HasKey(keys::kKioskSecondaryApps)) { |
109 const base::Value* secondary_apps = nullptr; | 109 const base::Value* secondary_apps = nullptr; |
110 const base::ListValue* list = nullptr; | 110 const base::ListValue* list = nullptr; |
111 if (!manifest->Get(keys::kKioskSecondaryApps, &secondary_apps) || | 111 if (!manifest->Get(keys::kKioskSecondaryApps, &secondary_apps) || |
112 !secondary_apps->GetAsList(&list)) { | 112 !secondary_apps->GetAsList(&list)) { |
113 *error = base::ASCIIToUTF16(manifest_errors::kInvalidKioskSecondaryApps); | 113 *error = base::ASCIIToUTF16(manifest_errors::kInvalidKioskSecondaryApps); |
114 return false; | 114 return false; |
115 } | 115 } |
116 | 116 |
117 for (const base::Value* value : *list) { | 117 for (const auto& value : *list) { |
118 std::unique_ptr<KioskSecondaryAppsType> app = | 118 std::unique_ptr<KioskSecondaryAppsType> app = |
119 KioskSecondaryAppsType::FromValue(*value, error); | 119 KioskSecondaryAppsType::FromValue(*value, error); |
120 if (!app) { | 120 if (!app) { |
121 *error = base::ASCIIToUTF16( | 121 *error = base::ASCIIToUTF16( |
122 manifest_errors::kInvalidKioskSecondaryAppsBadAppId); | 122 manifest_errors::kInvalidKioskSecondaryAppsBadAppId); |
123 return false; | 123 return false; |
124 } | 124 } |
125 ids.push_back(app->id); | 125 ids.push_back(app->id); |
126 } | 126 } |
127 } | 127 } |
(...skipping 14 matching lines...) Expand all Loading... |
142 new KioskModeInfo(kiosk_status, ids, required_platform_version)); | 142 new KioskModeInfo(kiosk_status, ids, required_platform_version)); |
143 | 143 |
144 return true; | 144 return true; |
145 } | 145 } |
146 | 146 |
147 const std::vector<std::string> KioskModeHandler::Keys() const { | 147 const std::vector<std::string> KioskModeHandler::Keys() const { |
148 return supported_keys_; | 148 return supported_keys_; |
149 } | 149 } |
150 | 150 |
151 } // namespace extensions | 151 } // namespace extensions |
OLD | NEW |