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 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_PROMPT_PREFS_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_PROMPT_PREFS_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_PROMPT_PREFS_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_PROMPT_PREFS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 class PrefServiceSyncable; | 10 class PrefRegistrySyncable; |
11 class PrefServiceBase; | 11 class PrefServiceBase; |
12 | 12 |
13 // Helper class for getting, changing bookmark prompt related preferences. | 13 // Helper class for getting, changing bookmark prompt related preferences. |
14 class BookmarkPromptPrefs { | 14 class BookmarkPromptPrefs { |
15 public: | 15 public: |
16 // Constructs and associates to |prefs|. Further operations occurred on | 16 // Constructs and associates to |prefs|. Further operations occurred on |
17 // associated |prefs|. | 17 // associated |prefs|. |
18 explicit BookmarkPromptPrefs(PrefServiceBase* prefs); | 18 explicit BookmarkPromptPrefs(PrefServiceBase* prefs); |
19 ~BookmarkPromptPrefs(); | 19 ~BookmarkPromptPrefs(); |
20 | 20 |
21 // Disables bookmark prompt feature. | 21 // Disables bookmark prompt feature. |
22 void DisableBookmarkPrompt(); | 22 void DisableBookmarkPrompt(); |
23 | 23 |
24 // Returns number of times bookmark prompt displayed so far. | 24 // Returns number of times bookmark prompt displayed so far. |
25 int GetPromptImpressionCount() const; | 25 int GetPromptImpressionCount() const; |
26 | 26 |
27 // Increments bookmark prompt impression counter. | 27 // Increments bookmark prompt impression counter. |
28 void IncrementPromptImpressionCount(); | 28 void IncrementPromptImpressionCount(); |
29 | 29 |
30 // Returns true if bookmark prompt feature enabled, otherwise false. | 30 // Returns true if bookmark prompt feature enabled, otherwise false. |
31 bool IsBookmarkPromptEnabled() const; | 31 bool IsBookmarkPromptEnabled() const; |
32 | 32 |
33 // Registers user preferences used by bookmark prompt feature. | 33 // Registers user preferences used by bookmark prompt feature. |
34 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 34 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
35 | 35 |
36 private: | 36 private: |
37 PrefServiceBase* prefs_; // Weak. | 37 PrefServiceBase* prefs_; // Weak. |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(BookmarkPromptPrefs); | 39 DISALLOW_COPY_AND_ASSIGN(BookmarkPromptPrefs); |
40 }; | 40 }; |
41 | 41 |
42 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_PROMPT_PREFS_H_ | 42 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_PROMPT_PREFS_H_ |
OLD | NEW |