OLD | NEW |
---|---|
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/extensions/api/bookmarks/bookmarks_api.h" | 5 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 bool BookmarksFunction::CanBeModified(const BookmarkNode* node) { | 202 bool BookmarksFunction::CanBeModified(const BookmarkNode* node) { |
203 if (!node) { | 203 if (!node) { |
204 error_ = keys::kNoParentError; | 204 error_ = keys::kNoParentError; |
205 return false; | 205 return false; |
206 } | 206 } |
207 if (node->is_root()) { | 207 if (node->is_root()) { |
208 error_ = keys::kModifySpecialError; | 208 error_ = keys::kModifySpecialError; |
209 return false; | 209 return false; |
210 } | 210 } |
211 ChromeBookmarkClient* client = GetChromeBookmarkClient(); | 211 ChromeBookmarkClient* client = GetChromeBookmarkClient(); |
212 if (client->IsDescendantOfManagedNode(node)) { | 212 if (client->IsDescendantOfManagedOrSupervisedNode(node)) { |
Pam (message me for reviews)
2015/01/14 14:03:37
The API description for "unmodifiable" will also n
Marc Treib
2015/01/14 16:40:50
Good catch! I've updated the description string in
| |
213 error_ = keys::kModifyManagedError; | 213 error_ = keys::kModifyManagedError; |
214 return false; | 214 return false; |
215 } | 215 } |
216 return true; | 216 return true; |
217 } | 217 } |
218 | 218 |
219 void BookmarksFunction::BookmarkModelChanged() { | 219 void BookmarksFunction::BookmarkModelChanged() { |
220 } | 220 } |
221 | 221 |
222 void BookmarksFunction::BookmarkModelLoaded(BookmarkModel* model, | 222 void BookmarksFunction::BookmarkModelLoaded(BookmarkModel* model, |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
841 } | 841 } |
842 | 842 |
843 void BookmarksExportFunction::FileSelected(const base::FilePath& path, | 843 void BookmarksExportFunction::FileSelected(const base::FilePath& path, |
844 int index, | 844 int index, |
845 void* params) { | 845 void* params) { |
846 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); | 846 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); |
847 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 847 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
848 } | 848 } |
849 | 849 |
850 } // namespace extensions | 850 } // namespace extensions |
OLD | NEW |