OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "ui/app_list/app_list_features.h" | 5 #include "ui/app_list/app_list_features.h" |
6 | 6 |
7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
8 #include "base/metrics/field_trial_params.h" | 8 #include "base/metrics/field_trial_params.h" |
9 #include "ui/app_list/app_list_switches.h" | 9 #include "ui/app_list/app_list_switches.h" |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 return switches::IsFullscreenAppListEnabled() || | 36 return switches::IsFullscreenAppListEnabled() || |
37 base::FeatureList::IsEnabled(kEnableFullscreenAppList); | 37 base::FeatureList::IsEnabled(kEnableFullscreenAppList); |
38 } | 38 } |
39 | 39 |
40 bool IsSearchResultsNewDesignEnabled() { | 40 bool IsSearchResultsNewDesignEnabled() { |
41 return IsFullscreenAppListEnabled() || | 41 return IsFullscreenAppListEnabled() || |
42 (IsAnswerCardEnabled() && !IsAnswerCardDarkRunEnabled()); | 42 (IsAnswerCardEnabled() && !IsAnswerCardDarkRunEnabled()); |
43 } | 43 } |
44 | 44 |
45 bool IsPlayStoreAppSearchEnabled() { | 45 bool IsPlayStoreAppSearchEnabled() { |
46 static const bool enabled = | 46 // Not using local static variable to allow tests to change this value. |
47 base::FeatureList::IsEnabled(kEnablePlayStoreAppSearch); | 47 return base::FeatureList::IsEnabled(kEnablePlayStoreAppSearch); |
48 return enabled; | |
49 } | 48 } |
50 | 49 |
51 int AnswerCardMaxWidth() { | 50 int AnswerCardMaxWidth() { |
52 static const int max_width = base::GetFieldTrialParamByFeatureAsInt( | 51 static const int max_width = base::GetFieldTrialParamByFeatureAsInt( |
53 kEnableAnswerCard, "CardMaxWidth", 608); | 52 kEnableAnswerCard, "CardMaxWidth", 608); |
54 return max_width; | 53 return max_width; |
55 } | 54 } |
56 | 55 |
57 int AnswerCardMaxHeight() { | 56 int AnswerCardMaxHeight() { |
58 static const int max_height = base::GetFieldTrialParamByFeatureAsInt( | 57 static const int max_height = base::GetFieldTrialParamByFeatureAsInt( |
59 kEnableAnswerCard, "CardMaxHeight", 266); | 58 kEnableAnswerCard, "CardMaxHeight", 266); |
60 return max_height; | 59 return max_height; |
61 } | 60 } |
62 | 61 |
63 std::string AnswerServerUrl() { | 62 std::string AnswerServerUrl() { |
64 return base::GetFieldTrialParamValueByFeature(kEnableAnswerCard, "ServerUrl"); | 63 return base::GetFieldTrialParamValueByFeature(kEnableAnswerCard, "ServerUrl"); |
65 } | 64 } |
66 | 65 |
67 } // namespace features | 66 } // namespace features |
68 } // namespace app_list | 67 } // namespace app_list |
OLD | NEW |