| 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 "base/memory/scoped_ptr.h" | 7 #include <memory> |
| 8 |
| 8 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 9 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 11 #include "base/values.h" | 12 #include "base/values.h" |
| 12 #include "base/version.h" | 13 #include "base/version.h" |
| 13 #include "extensions/common/api/extensions_manifest_types.h" | 14 #include "extensions/common/api/extensions_manifest_types.h" |
| 14 #include "extensions/common/manifest_constants.h" | 15 #include "extensions/common/manifest_constants.h" |
| 15 | 16 |
| 16 namespace extensions { | 17 namespace extensions { |
| 17 | 18 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 if (manifest->HasKey(keys::kKioskSecondaryApps)) { | 108 if (manifest->HasKey(keys::kKioskSecondaryApps)) { |
| 108 const base::Value* secondary_apps = nullptr; | 109 const base::Value* secondary_apps = nullptr; |
| 109 const base::ListValue* list = nullptr; | 110 const base::ListValue* list = nullptr; |
| 110 if (!manifest->Get(keys::kKioskSecondaryApps, &secondary_apps) || | 111 if (!manifest->Get(keys::kKioskSecondaryApps, &secondary_apps) || |
| 111 !secondary_apps->GetAsList(&list)) { | 112 !secondary_apps->GetAsList(&list)) { |
| 112 *error = base::ASCIIToUTF16(manifest_errors::kInvalidKioskSecondaryApps); | 113 *error = base::ASCIIToUTF16(manifest_errors::kInvalidKioskSecondaryApps); |
| 113 return false; | 114 return false; |
| 114 } | 115 } |
| 115 | 116 |
| 116 for (const base::Value* value : *list) { | 117 for (const base::Value* value : *list) { |
| 117 scoped_ptr<KioskSecondaryAppsType> app = | 118 std::unique_ptr<KioskSecondaryAppsType> app = |
| 118 KioskSecondaryAppsType::FromValue(*value, error); | 119 KioskSecondaryAppsType::FromValue(*value, error); |
| 119 if (!app) { | 120 if (!app) { |
| 120 *error = base::ASCIIToUTF16( | 121 *error = base::ASCIIToUTF16( |
| 121 manifest_errors::kInvalidKioskSecondaryAppsBadAppId); | 122 manifest_errors::kInvalidKioskSecondaryAppsBadAppId); |
| 122 return false; | 123 return false; |
| 123 } | 124 } |
| 124 ids.push_back(app->id); | 125 ids.push_back(app->id); |
| 125 } | 126 } |
| 126 } | 127 } |
| 127 | 128 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 141 new KioskModeInfo(kiosk_status, ids, required_platform_version)); | 142 new KioskModeInfo(kiosk_status, ids, required_platform_version)); |
| 142 | 143 |
| 143 return true; | 144 return true; |
| 144 } | 145 } |
| 145 | 146 |
| 146 const std::vector<std::string> KioskModeHandler::Keys() const { | 147 const std::vector<std::string> KioskModeHandler::Keys() const { |
| 147 return supported_keys_; | 148 return supported_keys_; |
| 148 } | 149 } |
| 149 | 150 |
| 150 } // namespace extensions | 151 } // namespace extensions |
| OLD | NEW |