| 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 "ui/app_list/app_list_constants.h" | 7 #include "ui/app_list/app_list_constants.h" |
| 8 #include "ui/app_list/app_list_switches.h" | 8 #include "ui/app_list/app_list_switches.h" |
| 9 #include "ui/app_list/app_list_view_delegate.h" | 9 #include "ui/app_list/app_list_view_delegate.h" |
| 10 #include "ui/app_list/views/app_list_main_view.h" | 10 #include "ui/app_list/views/app_list_main_view.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 SearchResultPageView::SearchResultPageView() : selected_index_(0) { | 49 SearchResultPageView::SearchResultPageView() : selected_index_(0) { |
| 50 if (switches::IsExperimentalAppListEnabled()) { | 50 if (switches::IsExperimentalAppListEnabled()) { |
| 51 gfx::ShadowValue shadow = GetShadowForZHeight(1); | 51 gfx::ShadowValue shadow = GetShadowForZHeight(1); |
| 52 scoped_ptr<views::Border> border(new views::ShadowBorder(shadow)); | 52 scoped_ptr<views::Border> border(new views::ShadowBorder(shadow)); |
| 53 | 53 |
| 54 gfx::Insets insets = gfx::Insets(kTopPadding, kExperimentalWindowPadding, 0, | 54 gfx::Insets insets = gfx::Insets(kTopPadding, kExperimentalSearchBoxPadding, |
| 55 kExperimentalWindowPadding); | 55 0, kExperimentalSearchBoxPadding); |
| 56 insets += -border->GetInsets(); | 56 insets += -border->GetInsets(); |
| 57 | 57 |
| 58 views::BoxLayout* layout = | 58 views::BoxLayout* layout = |
| 59 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, kGroupSpacing); | 59 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, kGroupSpacing); |
| 60 layout->set_inside_border_insets(insets); | 60 layout->set_inside_border_insets(insets); |
| 61 | 61 |
| 62 SetLayoutManager(layout); | 62 SetLayoutManager(layout); |
| 63 } else { | 63 } else { |
| 64 SetLayoutManager(new views::FillLayout); | 64 SetLayoutManager(new views::FillLayout); |
| 65 } | 65 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return index >= 0 && index < static_cast<int>(result_container_views_.size()); | 129 return index >= 0 && index < static_cast<int>(result_container_views_.size()); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void SearchResultPageView::ChildPreferredSizeChanged(views::View* child) { | 132 void SearchResultPageView::ChildPreferredSizeChanged(views::View* child) { |
| 133 DCHECK(!result_container_views_.empty()); | 133 DCHECK(!result_container_views_.empty()); |
| 134 Layout(); | 134 Layout(); |
| 135 SetSelectedIndex(0); | 135 SetSelectedIndex(0); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace app_list | 138 } // namespace app_list |
| OLD | NEW |