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

Side by Side Diff: chrome/browser/bookmarks/bookmark_prompt_prefs.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 7 years, 12 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) 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/bookmarks/bookmark_prompt_prefs.h" 5 #include "chrome/browser/bookmarks/bookmark_prompt_prefs.h"
6 6
7 #include "base/prefs/public/pref_service_base.h" 7 #include "chrome/browser/prefs/pref_service.h"
8 #include "chrome/common/pref_names.h" 8 #include "chrome/common/pref_names.h"
9 9
10 namespace { 10 namespace {
11 11
12 } // namespace 12 } // namespace
13 13
14 BookmarkPromptPrefs::BookmarkPromptPrefs(PrefServiceBase* user_prefs) 14 BookmarkPromptPrefs::BookmarkPromptPrefs(PrefServiceBase* user_prefs)
15 : prefs_(user_prefs) { 15 : prefs_(user_prefs) {
16 } 16 }
17 17
(...skipping 11 matching lines...) Expand all
29 void BookmarkPromptPrefs::IncrementPromptImpressionCount() { 29 void BookmarkPromptPrefs::IncrementPromptImpressionCount() {
30 prefs_->SetInteger(prefs::kBookmarkPromptImpressionCount, 30 prefs_->SetInteger(prefs::kBookmarkPromptImpressionCount,
31 GetPromptImpressionCount() + 1); 31 GetPromptImpressionCount() + 1);
32 } 32 }
33 33
34 bool BookmarkPromptPrefs::IsBookmarkPromptEnabled() const { 34 bool BookmarkPromptPrefs::IsBookmarkPromptEnabled() const {
35 return prefs_->GetBoolean(prefs::kBookmarkPromptEnabled); 35 return prefs_->GetBoolean(prefs::kBookmarkPromptEnabled);
36 } 36 }
37 37
38 // static 38 // static
39 void BookmarkPromptPrefs::RegisterUserPrefs(PrefServiceBase* user_prefs) { 39 void BookmarkPromptPrefs::RegisterUserPrefs(PrefServiceSyncable* user_prefs) {
40 // We always register preferences without checking FieldTrial, because 40 // We always register preferences without checking FieldTrial, because
41 // we may not receive field trial list from the server yet. 41 // we may not receive field trial list from the server yet.
42 user_prefs->RegisterBooleanPref(prefs::kBookmarkPromptEnabled, true, 42 user_prefs->RegisterBooleanPref(prefs::kBookmarkPromptEnabled, true,
43 PrefServiceBase::UNSYNCABLE_PREF); 43 PrefServiceSyncable::UNSYNCABLE_PREF);
44 user_prefs->RegisterIntegerPref(prefs::kBookmarkPromptImpressionCount, 0, 44 user_prefs->RegisterIntegerPref(prefs::kBookmarkPromptImpressionCount, 0,
45 PrefServiceBase::UNSYNCABLE_PREF); 45 PrefServiceSyncable::UNSYNCABLE_PREF);
46 } 46 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_prompt_prefs.h ('k') | chrome/browser/bookmarks/bookmark_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698