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

Side by Side Diff: chrome/browser/bookmarks/bookmark_manager_extension_api.cc

Issue 10837044: Correct const accessors in base/values.(h|cc), Part II (ListValue) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: David's comments Created 8 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bookmarks/bookmark_manager_extension_api.h" 5 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 if (!base::StringToInt64(id_string, &id)) 51 if (!base::StringToInt64(id_string, &id))
52 return NULL; 52 return NULL;
53 return model->GetNodeByID(id); 53 return model->GetNodeByID(id);
54 } 54 }
55 55
56 // Gets a vector of bookmark nodes from the argument list of IDs. 56 // Gets a vector of bookmark nodes from the argument list of IDs.
57 // This returns false in the case of failure. 57 // This returns false in the case of failure.
58 bool GetNodesFromArguments(BookmarkModel* model, const ListValue* args, 58 bool GetNodesFromArguments(BookmarkModel* model, const ListValue* args,
59 size_t args_index, std::vector<const BookmarkNode*>* nodes) { 59 size_t args_index, std::vector<const BookmarkNode*>* nodes) {
60 60
61 ListValue* ids; 61 const ListValue* ids;
62 if (!args->GetList(args_index, &ids)) 62 if (!args->GetList(args_index, &ids))
63 return false; 63 return false;
64 64
65 size_t count = ids->GetSize(); 65 size_t count = ids->GetSize();
66 if (count == 0) 66 if (count == 0)
67 return false; 67 return false;
68 68
69 for (size_t i = 0; i < count; ++i) { 69 for (size_t i = 0; i < count; ++i) {
70 std::string id_string; 70 std::string id_string;
71 if (!ids->GetString(i, &id_string)) 71 if (!ids->GetString(i, &id_string))
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 bool can_open_new_windows = true; 510 bool can_open_new_windows = true;
511 511
512 #if defined(OS_WIN) 512 #if defined(OS_WIN)
513 if (base::win::IsMetroProcess()) 513 if (base::win::IsMetroProcess())
514 can_open_new_windows = false; 514 can_open_new_windows = false;
515 #endif // OS_WIN 515 #endif // OS_WIN
516 516
517 SetResult(Value::CreateBooleanValue(can_open_new_windows)); 517 SetResult(Value::CreateBooleanValue(can_open_new_windows));
518 return true; 518 return true;
519 } 519 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_html_writer.cc ('k') | chrome/browser/chromeos/cros/cros_network_functions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698