| 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 "athena/home/bottom_home_view.h" | 5 #include "athena/home/bottom_home_view.h" |
| 6 | 6 |
| 7 #include "ui/app_list/app_list_item_list.h" | 7 #include "ui/app_list/app_list_item_list.h" |
| 8 #include "ui/app_list/app_list_model.h" | 8 #include "ui/app_list/app_list_model.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/search_box_view.h" | 10 #include "ui/app_list/views/search_box_view.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 views::BoxLayout::kVertical, 0, 0, 0)); | 23 views::BoxLayout::kVertical, 0, 0, 0)); |
| 24 | 24 |
| 25 app_list::AppListModel* model = view_delegate->GetModel(); | 25 app_list::AppListModel* model = view_delegate->GetModel(); |
| 26 app_list::AppListItemList* top_level = model->top_level_item_list(); | 26 app_list::AppListItemList* top_level = model->top_level_item_list(); |
| 27 | 27 |
| 28 views::View* items_container = new views::View(); | 28 views::View* items_container = new views::View(); |
| 29 AddChildView(items_container); | 29 AddChildView(items_container); |
| 30 | 30 |
| 31 views::BoxLayout* items_layout = new views::BoxLayout( | 31 views::BoxLayout* items_layout = new views::BoxLayout( |
| 32 views::BoxLayout::kHorizontal, 0, 0, 0); | 32 views::BoxLayout::kHorizontal, 0, 0, 0); |
| 33 items_layout->set_main_axis_alignment( | 33 items_layout->SetDefaultFlex(1); |
| 34 views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL); | |
| 35 items_container->SetLayoutManager(items_layout); | 34 items_container->SetLayoutManager(items_layout); |
| 36 for (size_t i = 0; i < top_level->item_count(); ++i) { | 35 for (size_t i = 0; i < top_level->item_count(); ++i) { |
| 37 app_list::TileItemView* tile_item_view = new app_list::TileItemView(); | 36 app_list::TileItemView* tile_item_view = new app_list::TileItemView(); |
| 38 tile_item_view->SetAppListItem(top_level->item_at(i)); | 37 tile_item_view->SetAppListItem(top_level->item_at(i)); |
| 39 items_container->AddChildView(tile_item_view); | 38 items_container->AddChildView(tile_item_view); |
| 40 } | 39 } |
| 41 | 40 |
| 42 app_list::SearchBoxView* search_box = new app_list::SearchBoxView( | 41 app_list::SearchBoxView* search_box = new app_list::SearchBoxView( |
| 43 this, view_delegate); | 42 this, view_delegate); |
| 44 AddChildView(search_box); | 43 AddChildView(search_box); |
| 45 } | 44 } |
| 46 | 45 |
| 47 BottomHomeView::~BottomHomeView() {} | 46 BottomHomeView::~BottomHomeView() {} |
| 48 | 47 |
| 49 void BottomHomeView::QueryChanged(app_list::SearchBoxView* sender) { | 48 void BottomHomeView::QueryChanged(app_list::SearchBoxView* sender) { |
| 50 // Nothing needs to be done. | 49 // Nothing needs to be done. |
| 51 } | 50 } |
| 52 | 51 |
| 53 } // namespace athena | 52 } // namespace athena |
| OLD | NEW |