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

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

Issue 6931018: Initial implementation of "Synced Bookmarks" folder. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge Created 9 years, 7 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_bookmark_helpers.h" 5 #include "chrome/browser/extensions/extension_bookmark_helpers.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" 10 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 int64 id, 85 int64 id,
86 bool recursive, 86 bool recursive,
87 std::string* error) { 87 std::string* error) {
88 const BookmarkNode* node = model->GetNodeByID(id); 88 const BookmarkNode* node = model->GetNodeByID(id);
89 if (!node) { 89 if (!node) {
90 *error = keys::kNoNodeError; 90 *error = keys::kNoNodeError;
91 return false; 91 return false;
92 } 92 }
93 if (node == model->root_node() || 93 if (node == model->root_node() ||
94 node == model->other_node() || 94 node == model->other_node() ||
95 node == model->synced_node() ||
95 node == model->GetBookmarkBarNode()) { 96 node == model->GetBookmarkBarNode()) {
96 *error = keys::kModifySpecialError; 97 *error = keys::kModifySpecialError;
97 return false; 98 return false;
98 } 99 }
99 if (node->is_folder() && node->child_count() > 0 && !recursive) { 100 if (node->is_folder() && node->child_count() > 0 && !recursive) {
100 *error = keys::kFolderNotEmptyError; 101 *error = keys::kFolderNotEmptyError;
101 return false; 102 return false;
102 } 103 }
103 104
104 const BookmarkNode* parent = node->parent(); 105 const BookmarkNode* parent = node->parent();
105 int index = parent->GetIndexOf(node); 106 int index = parent->GetIndexOf(node);
106 model->Remove(parent, index); 107 model->Remove(parent, index);
107 return true; 108 return true;
108 } 109 }
109 110
110 } 111 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/recently_used_folders_combo_model.cc ('k') | chrome/browser/history/history_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698