| 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 19 matching lines...) Expand all Loading... |
| 30 const int kTopPadding = 8; | 30 const int kTopPadding = 8; |
| 31 | 31 |
| 32 // The z-height of the search box and cards in this view. | 32 // The z-height of the search box and cards in this view. |
| 33 const int kSearchResultZHeight = 1; | 33 const int kSearchResultZHeight = 1; |
| 34 | 34 |
| 35 // A container view that ensures the card background and the shadow are painted | 35 // A container view that ensures the card background and the shadow are painted |
| 36 // in the correct order. | 36 // in the correct order. |
| 37 class SearchCardView : public views::View { | 37 class SearchCardView : public views::View { |
| 38 public: | 38 public: |
| 39 explicit SearchCardView(views::View* content_view) { | 39 explicit SearchCardView(views::View* content_view) { |
| 40 SetBorder(base::WrapUnique( | 40 SetBorder(base::MakeUnique<views::ShadowBorder>( |
| 41 new views::ShadowBorder(GetShadowForZHeight(kSearchResultZHeight)))); | 41 GetShadowForZHeight(kSearchResultZHeight))); |
| 42 SetLayoutManager(new views::FillLayout()); | 42 SetLayoutManager(new views::FillLayout()); |
| 43 content_view->set_background( | 43 content_view->set_background( |
| 44 views::Background::CreateSolidBackground(kCardBackgroundColor)); | 44 views::Background::CreateSolidBackground(kCardBackgroundColor)); |
| 45 AddChildView(content_view); | 45 AddChildView(content_view); |
| 46 } | 46 } |
| 47 | 47 |
| 48 ~SearchCardView() override {} | 48 ~SearchCardView() override {} |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 return switches::IsExperimentalAppListEnabled() | 247 return switches::IsExperimentalAppListEnabled() |
| 248 ? kSearchResultZHeight | 248 ? kSearchResultZHeight |
| 249 : AppListPage::GetSearchBoxZHeight(); | 249 : AppListPage::GetSearchBoxZHeight(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void SearchResultPageView::OnHidden() { | 252 void SearchResultPageView::OnHidden() { |
| 253 ClearSelectedIndex(); | 253 ClearSelectedIndex(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace app_list | 256 } // namespace app_list |
| OLD | NEW |