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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 bool BookmarksFunction::CanBeModified(const BookmarkNode* node) { | 204 bool BookmarksFunction::CanBeModified(const BookmarkNode* node) { |
205 if (!node) { | 205 if (!node) { |
206 error_ = keys::kNoParentError; | 206 error_ = keys::kNoParentError; |
207 return false; | 207 return false; |
208 } | 208 } |
209 if (node->is_root()) { | 209 if (node->is_root()) { |
210 error_ = keys::kModifySpecialError; | 210 error_ = keys::kModifySpecialError; |
211 return false; | 211 return false; |
212 } | 212 } |
213 ChromeBookmarkClient* client = GetChromeBookmarkClient(); | 213 ChromeBookmarkClient* client = GetChromeBookmarkClient(); |
214 if (client->IsDescendantOfManagedNode(node)) { | 214 if (client->IsDescendantOfManagedOrSupervisedNode(node)) { |
215 error_ = keys::kModifyManagedError; | 215 error_ = keys::kModifyManagedError; |
216 return false; | 216 return false; |
217 } | 217 } |
218 return true; | 218 return true; |
219 } | 219 } |
220 | 220 |
221 void BookmarksFunction::BookmarkModelChanged() { | 221 void BookmarksFunction::BookmarkModelChanged() { |
222 } | 222 } |
223 | 223 |
224 void BookmarksFunction::BookmarkModelLoaded(BookmarkModel* model, | 224 void BookmarksFunction::BookmarkModelLoaded(BookmarkModel* model, |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 } | 843 } |
844 | 844 |
845 void BookmarksExportFunction::FileSelected(const base::FilePath& path, | 845 void BookmarksExportFunction::FileSelected(const base::FilePath& path, |
846 int index, | 846 int index, |
847 void* params) { | 847 void* params) { |
848 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); | 848 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); |
849 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 849 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
850 } | 850 } |
851 | 851 |
852 } // namespace extensions | 852 } // namespace extensions |
OLD | NEW |