Chromium Code Reviews| Index: ui/app_list/views/search_box_view.cc |
| diff --git a/ui/app_list/views/search_box_view.cc b/ui/app_list/views/search_box_view.cc |
| index 599f298e8c5f24eec2bbe104450765527e879a72..4e1bedfed44cd0e398f11ef5a312ab100b3cf98c 100644 |
| --- a/ui/app_list/views/search_box_view.cc |
| +++ b/ui/app_list/views/search_box_view.cc |
| @@ -53,10 +53,11 @@ const SkColor kHintTextColor = SkColorSetRGB(0xA0, 0xA0, 0xA0); |
| const int kBackgroundBorderCornerRadius = 2; |
| const int kBackgroundBorderCornerRadiusFullscreen = 20; |
| +// Sets the switch that is used to check if the fullscreen app list feature is |
| +// enabled. |
| bool IsFullscreenAppListEnabled() { |
|
xiyuan
2017/06/12 22:33:15
We probably can get rid of this.
newcomer
2017/06/12 23:48:17
Done.
|
| // Cache this value to avoid repeated lookup. |
|
xiyuan
2017/06/12 22:33:15
nit: Wrong comment if we keep the function.
newcomer
2017/06/12 23:48:17
Done.
|
| - static bool cached_value = features::IsFullscreenAppListEnabled(); |
| - return cached_value; |
| + return features::IsFullscreenAppListEnabled(); |
| } |
| // A background that paints a solid white rounded rect with a thin grey border. |
| @@ -143,8 +144,9 @@ SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate, |
| contents_view_(NULL), |
| app_list_view_(app_list_view), |
| focused_view_(FOCUS_SEARCH_BOX) { |
| + is_fullscreen_app_list_enabled_ = IsFullscreenAppListEnabled(); |
|
xiyuan
2017/06/12 22:33:15
nit: make |is_fullscreen_app_list_enabled_| a cons
newcomer
2017/06/12 23:48:17
Done.
|
| SetLayoutManager(new views::FillLayout); |
| - SetPreferredSize(gfx::Size(IsFullscreenAppListEnabled() |
| + SetPreferredSize(gfx::Size(is_fullscreen_app_list_enabled_ |
| ? kPreferredWidthFullscreen |
| : kPreferredWidth, |
| kPreferredHeight)); |
| @@ -346,7 +348,7 @@ void SearchBoxView::ContentsChanged(views::Textfield* sender, |
| view_delegate_->AutoLaunchCanceled(); |
| NotifyQueryChanged(); |
| - if (IsFullscreenAppListEnabled() && !app_list_view_->is_fullscreen()) { |
| + if (is_fullscreen_app_list_enabled_ && !app_list_view_->is_fullscreen()) { |
| // If the app list is in the peeking state, switch it to fullscreen. |
| app_list_view_->SetState(AppListView::FULLSCREEN); |
| } |