Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/common/extensions/api/file_browser_handlers/file_browser_handle r.h" 5 #include "chrome/common/extensions/api/file_browser_handlers/file_browser_handle r.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 return result; 247 return result;
248 } 248 }
249 249
250 // Loads FileBrowserHandlers from |extension_actions| into a list in |result|. 250 // Loads FileBrowserHandlers from |extension_actions| into a list in |result|.
251 bool LoadFileBrowserHandlers( 251 bool LoadFileBrowserHandlers(
252 const std::string& extension_id, 252 const std::string& extension_id,
253 const base::ListValue* extension_actions, 253 const base::ListValue* extension_actions,
254 FileBrowserHandler::List* result, 254 FileBrowserHandler::List* result,
255 base::string16* error) { 255 base::string16* error) {
256 for (const auto& entry : *extension_actions) { 256 for (const auto& entry : *extension_actions) {
257 const base::DictionaryValue* dict; 257 base::DictionaryValue* dict;
258 if (!entry.GetAsDictionary(&dict)) { 258 if (!entry->GetAsDictionary(&dict)) {
259 *error = base::ASCIIToUTF16(errors::kInvalidFileBrowserHandler); 259 *error = base::ASCIIToUTF16(errors::kInvalidFileBrowserHandler);
260 return false; 260 return false;
261 } 261 }
262 std::unique_ptr<FileBrowserHandler> action = 262 std::unique_ptr<FileBrowserHandler> action =
263 LoadFileBrowserHandler(extension_id, dict, error); 263 LoadFileBrowserHandler(extension_id, dict, error);
264 if (!action) 264 if (!action)
265 return false; // Failed to parse file browser action definition. 265 return false; // Failed to parse file browser action definition.
266 result->push_back(std::move(action)); 266 result->push_back(std::move(action));
267 } 267 }
268 return true; 268 return true;
(...skipping 30 matching lines...) Expand all
299 return false; // Failed to parse file browser actions definition. 299 return false; // Failed to parse file browser actions definition.
300 } 300 }
301 301
302 extension->SetManifestData(keys::kFileBrowserHandlers, std::move(info)); 302 extension->SetManifestData(keys::kFileBrowserHandlers, std::move(info));
303 return true; 303 return true;
304 } 304 }
305 305
306 const std::vector<std::string> FileBrowserHandlerParser::Keys() const { 306 const std::vector<std::string> FileBrowserHandlerParser::Keys() const {
307 return SingleKey(keys::kFileBrowserHandlers); 307 return SingleKey(keys::kFileBrowserHandlers);
308 } 308 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698