This source file includes following definitions.
- DisableBookmarkPrompt
- GetPromptImpressionCount
- IncrementPromptImpressionCount
- IsBookmarkPromptEnabled
- RegisterProfilePrefs
#include "chrome/browser/bookmarks/bookmark_prompt_prefs.h"
#include "base/prefs/pref_service.h"
#include "chrome/common/pref_names.h"
#include "components/user_prefs/pref_registry_syncable.h"
BookmarkPromptPrefs::BookmarkPromptPrefs(PrefService* user_prefs)
: prefs_(user_prefs) {
}
BookmarkPromptPrefs::~BookmarkPromptPrefs() {
}
void BookmarkPromptPrefs::DisableBookmarkPrompt() {
prefs_->SetBoolean(prefs::kBookmarkPromptEnabled, false);
}
int BookmarkPromptPrefs::GetPromptImpressionCount() const {
return prefs_->GetInteger(prefs::kBookmarkPromptImpressionCount);
}
void BookmarkPromptPrefs::IncrementPromptImpressionCount() {
prefs_->SetInteger(prefs::kBookmarkPromptImpressionCount,
GetPromptImpressionCount() + 1);
}
bool BookmarkPromptPrefs::IsBookmarkPromptEnabled() const {
return prefs_->GetBoolean(prefs::kBookmarkPromptEnabled);
}
void BookmarkPromptPrefs::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kBookmarkPromptEnabled,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kBookmarkPromptImpressionCount,
0,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}