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

Side by Side Diff: chrome/browser/extensions/extension_bookmarks_module.cc

Issue 7753020: Revert recent changes to base::Value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extensions/extension_bookmarks_module.h" 5 #include "chrome/browser/extensions/extension_bookmarks_module.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/i18n/file_util_icu.h" 8 #include "base/i18n/file_util_icu.h"
9 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 DispatchEvent(model->profile(), 278 DispatchEvent(model->profile(),
279 keys::kOnBookmarkImportEnded, 279 keys::kOnBookmarkImportEnded,
280 json_args); 280 json_args);
281 } 281 }
282 282
283 bool GetBookmarksFunction::RunImpl() { 283 bool GetBookmarksFunction::RunImpl() {
284 BookmarkModel* model = profile()->GetBookmarkModel(); 284 BookmarkModel* model = profile()->GetBookmarkModel();
285 scoped_ptr<ListValue> json(new ListValue()); 285 scoped_ptr<ListValue> json(new ListValue());
286 Value* arg0; 286 Value* arg0;
287 EXTENSION_FUNCTION_VALIDATE(args_->Get(0, &arg0)); 287 EXTENSION_FUNCTION_VALIDATE(args_->Get(0, &arg0));
288 if (const ListValue* ids = arg0->AsList()) { 288 if (arg0->IsType(Value::TYPE_LIST)) {
289 const ListValue* ids = static_cast<const ListValue*>(arg0);
289 size_t count = ids->GetSize(); 290 size_t count = ids->GetSize();
290 EXTENSION_FUNCTION_VALIDATE(count > 0); 291 EXTENSION_FUNCTION_VALIDATE(count > 0);
291 for (size_t i = 0; i < count; ++i) { 292 for (size_t i = 0; i < count; ++i) {
292 int64 id; 293 int64 id;
293 std::string id_string; 294 std::string id_string;
294 EXTENSION_FUNCTION_VALIDATE(ids->GetString(i, &id_string)); 295 EXTENSION_FUNCTION_VALIDATE(ids->GetString(i, &id_string));
295 if (!GetBookmarkIdAsInt64(id_string, &id)) 296 if (!GetBookmarkIdAsInt64(id_string, &id))
296 return false; 297 return false;
297 const BookmarkNode* node = model->GetNodeByID(id); 298 const BookmarkNode* node = model->GetNodeByID(id);
298 if (!node) { 299 if (!node) {
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE); 932 SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE);
932 return true; 933 return true;
933 } 934 }
934 935
935 void ExportBookmarksFunction::FileSelected(const FilePath& path, 936 void ExportBookmarksFunction::FileSelected(const FilePath& path,
936 int index, 937 int index,
937 void* params) { 938 void* params) {
938 bookmark_html_writer::WriteBookmarks(profile(), path, NULL); 939 bookmark_html_writer::WriteBookmarks(profile(), path, NULL);
939 Release(); // Balanced in BookmarksIOFunction::SelectFile() 940 Release(); // Balanced in BookmarksIOFunction::SelectFile()
940 } 941 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/network_parser.cc ('k') | chrome/browser/extensions/extension_tabs_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698