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/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 Loading... |
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 } |
OLD | NEW |