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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 const base::Value* secondary_apps = nullptr; | 112 const base::Value* secondary_apps = nullptr; |
113 const base::ListValue* list = nullptr; | 113 const base::ListValue* list = nullptr; |
114 if (!manifest->Get(keys::kKioskSecondaryApps, &secondary_apps) || | 114 if (!manifest->Get(keys::kKioskSecondaryApps, &secondary_apps) || |
115 !secondary_apps->GetAsList(&list)) { | 115 !secondary_apps->GetAsList(&list)) { |
116 *error = base::ASCIIToUTF16(manifest_errors::kInvalidKioskSecondaryApps); | 116 *error = base::ASCIIToUTF16(manifest_errors::kInvalidKioskSecondaryApps); |
117 return false; | 117 return false; |
118 } | 118 } |
119 | 119 |
120 for (const auto& value : *list) { | 120 for (const auto& value : *list) { |
121 std::unique_ptr<KioskSecondaryAppsType> app = | 121 std::unique_ptr<KioskSecondaryAppsType> app = |
122 KioskSecondaryAppsType::FromValue(value, error); | 122 KioskSecondaryAppsType::FromValue(*value, error); |
123 if (!app) { | 123 if (!app) { |
124 *error = base::ASCIIToUTF16( | 124 *error = base::ASCIIToUTF16( |
125 manifest_errors::kInvalidKioskSecondaryAppsBadAppId); | 125 manifest_errors::kInvalidKioskSecondaryAppsBadAppId); |
126 return false; | 126 return false; |
127 } | 127 } |
128 ids.push_back(app->id); | 128 ids.push_back(app->id); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 // Optional kiosk.required_platform_version key. | 132 // Optional kiosk.required_platform_version key. |
(...skipping 21 matching lines...) Expand all Loading... |
154 kiosk_status, ids, required_platform_version, always_update)); | 154 kiosk_status, ids, required_platform_version, always_update)); |
155 | 155 |
156 return true; | 156 return true; |
157 } | 157 } |
158 | 158 |
159 const std::vector<std::string> KioskModeHandler::Keys() const { | 159 const std::vector<std::string> KioskModeHandler::Keys() const { |
160 return supported_keys_; | 160 return supported_keys_; |
161 } | 161 } |
162 | 162 |
163 } // namespace extensions | 163 } // namespace extensions |
OLD | NEW |