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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" | 7 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 if (!node) { | 248 if (!node) { |
249 error_ = keys::kNoNodeError; | 249 error_ = keys::kNoNodeError; |
250 return NULL; | 250 return NULL; |
251 } | 251 } |
252 | 252 |
253 return node; | 253 return node; |
254 } | 254 } |
255 | 255 |
256 bool BookmarksFunction::EditBookmarksEnabled() { | 256 bool BookmarksFunction::EditBookmarksEnabled() { |
257 PrefService* prefs = user_prefs::UserPrefs::Get(GetProfile()); | 257 PrefService* prefs = user_prefs::UserPrefs::Get(GetProfile()); |
258 if (prefs->GetBoolean(prefs::kEditBookmarksEnabled)) | 258 if (prefs->GetBoolean(::bookmarks::prefs::kEditBookmarksEnabled)) |
259 return true; | 259 return true; |
260 error_ = keys::kEditBookmarksDisabled; | 260 error_ = keys::kEditBookmarksDisabled; |
261 return false; | 261 return false; |
262 } | 262 } |
263 | 263 |
264 bool BookmarksFunction::CanBeModified(const BookmarkNode* node) { | 264 bool BookmarksFunction::CanBeModified(const BookmarkNode* node) { |
265 if (!node) { | 265 if (!node) { |
266 error_ = keys::kNoParentError; | 266 error_ = keys::kNoParentError; |
267 return false; | 267 return false; |
268 } | 268 } |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 } | 906 } |
907 | 907 |
908 void BookmarksExportFunction::FileSelected(const base::FilePath& path, | 908 void BookmarksExportFunction::FileSelected(const base::FilePath& path, |
909 int index, | 909 int index, |
910 void* params) { | 910 void* params) { |
911 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); | 911 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); |
912 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 912 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
913 } | 913 } |
914 | 914 |
915 } // namespace extensions | 915 } // namespace extensions |
OLD | NEW |