| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/views/search_result_page_view.h" | 5 #include "ui/app_list/views/search_result_page_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 int GetThickness() const override { return 0; } | 63 int GetThickness() const override { return 0; } |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 DISALLOW_COPY_AND_ASSIGN(ZeroWidthVerticalScrollBar); | 66 DISALLOW_COPY_AND_ASSIGN(ZeroWidthVerticalScrollBar); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace | 69 } // namespace |
| 70 | 70 |
| 71 SearchResultPageView::SearchResultPageView() | 71 SearchResultPageView::SearchResultPageView() |
| 72 : selected_index_(0), | 72 : selected_index_(0), |
| 73 is_fullscreen_app_list_enabled_(features::IsFullscreenAppListEnabled()), | 73 is_new_design_(features::IsSearchResultsNewDesignEnabled()), |
| 74 contents_view_(new views::View) { | 74 contents_view_(new views::View) { |
| 75 gfx::ShadowValue shadow = GetShadowForZHeight(kSearchResultZHeight); | 75 gfx::ShadowValue shadow = GetShadowForZHeight(kSearchResultZHeight); |
| 76 std::unique_ptr<views::Border> border(new views::ShadowBorder(shadow)); | 76 std::unique_ptr<views::Border> border(new views::ShadowBorder(shadow)); |
| 77 | 77 |
| 78 gfx::Insets insets = | 78 gfx::Insets insets = |
| 79 gfx::Insets(kTopPadding, kSearchBoxPadding, 0, kSearchBoxPadding); | 79 gfx::Insets(kTopPadding, kSearchBoxPadding, 0, kSearchBoxPadding); |
| 80 insets += -border->GetInsets(); | 80 insets += -border->GetInsets(); |
| 81 | 81 |
| 82 views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical, | 82 views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical, |
| 83 gfx::Insets(), kGroupSpacing); | 83 gfx::Insets(), kGroupSpacing); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // the top. | 239 // the top. |
| 240 ClearSelectedIndex(); | 240 ClearSelectedIndex(); |
| 241 SetSelectedIndex(new_selection_index, false); | 241 SetSelectedIndex(new_selection_index, false); |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 | 244 |
| 245 gfx::Rect SearchResultPageView::GetPageBoundsForState( | 245 gfx::Rect SearchResultPageView::GetPageBoundsForState( |
| 246 AppListModel::State state) const { | 246 AppListModel::State state) const { |
| 247 gfx::Rect onscreen_bounds = GetDefaultContentsBounds(); | 247 gfx::Rect onscreen_bounds = GetDefaultContentsBounds(); |
| 248 | 248 |
| 249 if (is_fullscreen_app_list_enabled_) | 249 if (is_new_design_) |
| 250 onscreen_bounds.set_height(kFullscreenHeight); | 250 onscreen_bounds.set_height(kFullscreenHeight); |
| 251 | 251 |
| 252 switch (state) { | 252 switch (state) { |
| 253 case AppListModel::STATE_SEARCH_RESULTS: | 253 case AppListModel::STATE_SEARCH_RESULTS: |
| 254 return onscreen_bounds; | 254 return onscreen_bounds; |
| 255 default: | 255 default: |
| 256 return GetAboveContentsOffscreenBounds(onscreen_bounds.size()); | 256 return GetAboveContentsOffscreenBounds(onscreen_bounds.size()); |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 | 259 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 275 | 275 |
| 276 int SearchResultPageView::GetSearchBoxZHeight() const { | 276 int SearchResultPageView::GetSearchBoxZHeight() const { |
| 277 return kSearchResultZHeight; | 277 return kSearchResultZHeight; |
| 278 } | 278 } |
| 279 | 279 |
| 280 void SearchResultPageView::OnHidden() { | 280 void SearchResultPageView::OnHidden() { |
| 281 ClearSelectedIndex(); | 281 ClearSelectedIndex(); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace app_list | 284 } // namespace app_list |
| OLD | NEW |