OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ENHANCED_BOOKMARKS_FEATURES_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_ENHANCED_BOOKMARKS_FEATURES_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_ENHANCED_BOOKMARKS_FEATURES_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_ENHANCED_BOOKMARKS_FEATURES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "extensions/common/extension.h" | 10 #include "extensions/common/extension.h" |
11 | 11 |
12 class PrefService; | 12 class PrefService; |
13 | 13 |
14 // States for bookmark experiment. They are set by Chrome sync into | 14 // States for bookmark experiment. They are set by Chrome sync into |
15 // sync_driver::prefs::kEnhancedBookmarksExperimentEnabled user preference and | 15 // sync_driver::prefs::kEnhancedBookmarksExperimentEnabled user preference and |
16 // used for UMA reporting as well. | 16 // used for UMA reporting as well. |
17 enum BookmarksExperimentState { | 17 enum BookmarksExperimentState { |
18 kNoBookmarksExperiment, | 18 kNoBookmarksExperiment, |
sky
2014/05/23 19:51:56
This is the wrong style for enums in chrome, they
| |
19 kBookmarksExperimentEnabled, | 19 kBookmarksExperimentEnabled, |
20 kBookmarksExperimentEnabledUserOptOut, | 20 kBookmarksExperimentEnabledUserOptOut, |
21 kBookmarksExperimentEnabledFromFinch, | 21 kBookmarksExperimentEnabledFromFinch, |
22 kBookmarksExperimentOptOutFromFinch, | 22 kBookmarksExperimentOptOutFromFinch, |
23 kBookmarksExperimentEnabledFromFinchUserSignedIn, | 23 kBookmarksExperimentEnabledFromFinchUserSignedIn, |
24 kBookmarksExperimentEnabledFromSyncUnknown, | |
24 kBookmarksExperimentEnumSize | 25 kBookmarksExperimentEnumSize |
25 }; | 26 }; |
26 | 27 |
27 // Returns true and sets |extension_id| if bookmarks experiment enabled | 28 // Returns true and sets |extension_id| if bookmarks experiment enabled |
28 // false if no bookmark experiment or extension id is empty. | 29 // false if no bookmark experiment or extension id is empty. |
29 bool GetBookmarksExperimentExtensionID(const PrefService* user_prefs, | 30 bool GetBookmarksExperimentExtensionID(const PrefService* user_prefs, |
30 std::string* extension_id); | 31 std::string* extension_id); |
31 | 32 |
32 // Updates bookmark experiment state based on information from Chrome sync | 33 // Updates bookmark experiment state based on information from Chrome sync |
33 // and Finch experiments. | 34 // and Finch experiments. |
34 void UpdateBookmarksExperimentState(PrefService* user_prefs, | 35 void UpdateBookmarksExperimentState( |
35 PrefService* local_state, | 36 PrefService* user_prefs, |
36 bool user_signed_in); | 37 PrefService* local_state, |
38 bool user_signed_in, | |
39 BookmarksExperimentState experiment_enabled_from_sync); | |
37 | 40 |
38 // Sets flag to opt-in user into Finch experiment. | 41 // Sets flag to opt-in user into Finch experiment. |
39 void ForceFinchBookmarkExperimentIfNeeded( | 42 void ForceFinchBookmarkExperimentIfNeeded( |
40 PrefService* local_state, | 43 PrefService* local_state, |
41 BookmarksExperimentState bookmarks_experiment_state); | 44 BookmarksExperimentState bookmarks_experiment_state); |
42 | 45 |
43 // Returns true if enhanced bookmarks experiment is enabled. | 46 // Returns true if enhanced bookmarks experiment is enabled. |
44 // Experiment could be enable from Chrome sync or from Finch. | 47 // Experiment could be enable from Chrome sync or from Finch. |
45 bool IsEnhancedBookmarksExperimentEnabled(); | 48 bool IsEnhancedBookmarksExperimentEnabled(); |
46 | 49 |
47 // Returns true when flag enable-dom-distiller is set or enabled from Finch. | 50 // Returns true when flag enable-dom-distiller is set or enabled from Finch. |
48 bool IsEnableDomDistillerSet(); | 51 bool IsEnableDomDistillerSet(); |
49 | 52 |
50 // Returns true when flag enable-sync-articles is set or enabled from Finch. | 53 // Returns true when flag enable-sync-articles is set or enabled from Finch. |
51 bool IsEnableSyncArticlesSet(); | 54 bool IsEnableSyncArticlesSet(); |
52 | 55 |
53 #endif // CHROME_BROWSER_BOOKMARKS_ENHANCED_BOOKMARKS_FEATURES_H_ | 56 #endif // CHROME_BROWSER_BOOKMARKS_ENHANCED_BOOKMARKS_FEATURES_H_ |
OLD | NEW |