1 // Copyright 2018 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef COMPONENTS_SEARCH_NTP_FEATURES_H_ 6 #define COMPONENTS_SEARCH_NTP_FEATURES_H_ 7 8 #include "base/feature_list.h" 9 10 namespace base { 11 class Time; 12 } // namespace base 13 14 namespace ntp_features { 15 16 // The features should be documented alongside the definition of their values in 17 // the .cc file. 18 19 extern const base::Feature kConfirmSuggestionRemovals; 20 extern const base::Feature kDismissPromos; 21 extern const base::Feature kIframeOneGoogleBar; 22 extern const base::Feature kNtpRepeatableQueries; 23 extern const base::Feature kOneGoogleBarModalOverlays; 24 extern const base::Feature kRealboxMatchOmniboxTheme; 25 extern const base::Feature kRealboxUseGoogleGIcon; 26 extern const base::Feature kWebUI; 27 extern const base::Feature kWebUIThemeModeDoodles; 28 extern const base::Feature kModules; 29 extern const base::Feature kNtpRecipeTasksModule; 30 extern const base::Feature kNtpShoppingTasksModule; 31 32 extern const base::Feature kSearchSuggestChips; 33 extern const base::Feature kDisableSearchSuggestChips; 34 35 extern const base::Feature kNtpHandleMostVisitedNavigationExplicitly; 36 37 // Parameter name determining the age threshold in days for local history 38 // repeatable queries. 39 // The value of this parameter should be parsable as an unsigned integer. 40 extern const char kNtpRepeatableQueriesAgeThresholdDaysParam[]; 41 // Parameter name determining the number of seconds until the recency component 42 // of the frecency score for local history repeatable queries decays to half. 43 // The value of this parameter should be parsable as an unsigned integer. 44 extern const char kNtpRepeatableQueriesRecencyHalfLifeSecondsParam[]; 45 // Parameter name determining the factor by which the frequency component of the 46 // frecency score for local history repeatable queries is exponentiated. 47 // The value of this parameter should be parsable as a double. 48 extern const char kNtpRepeatableQueriesFrequencyExponentParam[]; 49 // Parameter name determining the position, with respect to the MV tiles, in 50 // which the repeatable queries should be inserted. 51 extern const char kNtpRepeatableQueriesInsertPositionParam[]; 52 // The available positions, with respect to the MV tiles, in which the 53 // repeatable queries can be inserted. 54 enum class RepeatableQueriesInsertPosition { 55 kStart = 0, // At the start of MV tiles. 56 kEnd, // At the end of MV tiles. 57 }; 58 59 // Parameter determining the type of stateful data to request. 60 extern const char kNtpStatefulTasksModuleDataParam[]; 61 62 // Returns the age threshold for local history repeatable queries. 63 base::Time GetLocalHistoryRepeatableQueriesAgeThreshold(); 64 // Returns the number of seconds until the recency component of the frecency 65 // score for local history repeatable queries decays to half. 66 int GetLocalHistoryRepeatableQueriesRecencyHalfLifeSeconds(); 67 // Returns the factor by which the frequency component of the frecency score for 68 // local history repeatable queries is exponentiated. 69 double GetLocalHistoryRepeatableQueriesFrequencyExponent(); 70 // Returns the position, with respect to the MV tiles, in which the repeatable 71 // queries should be inserted. 72 RepeatableQueriesInsertPosition GetRepeatableQueriesInsertPosition(); 73 74 } // namespace ntp_features 75 76 #endif // COMPONENTS_SEARCH_NTP_FEATURES_H_ 77