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

Unified Diff: chrome/browser/extensions/api/bookmarks/bookmarks_api.cc

Issue 12340111: Introduce //components/user_prefs, use to eliminate c/b/prefs dependency in Autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge of LKGR Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
index 3c501f3c61dd86d97d66cf6374b47d3aaf498261..64e7da564777d4dbbbc7fa65ccbb12baa0f606a9 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
+++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
@@ -39,6 +39,7 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/api/bookmarks.h"
#include "chrome/common/pref_names.h"
+#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/notification_service.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -116,7 +117,7 @@ bool BookmarksFunction::GetBookmarkIdAsInt64(const std::string& id_string,
}
bool BookmarksFunction::EditBookmarksEnabled() {
- PrefService* prefs = PrefServiceFromBrowserContext(profile_);
+ PrefService* prefs = components::UserPrefs::Get(profile_);
if (prefs->GetBoolean(prefs::kEditBookmarksEnabled))
return true;
error_ = keys::kEditBookmarksDisabled;
@@ -431,7 +432,7 @@ bool BookmarksSearchFunction::RunImpl() {
bookmarks::Search::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
- PrefService* prefs = PrefServiceFromBrowserContext(profile_);
+ PrefService* prefs = components::UserPrefs::Get(profile_);
std::string lang = prefs->GetString(prefs::kAcceptLanguages);
std::vector<const BookmarkNode*> nodes;
bookmark_utils::GetBookmarksContainingText(

Powered by Google App Engine
This is Rietveld 408576698