Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2217)

Unified Diff: athena/home/bottom_home_view.cc

Issue 397343003: Introduce centered view and bottom view for home card. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/home/bottom_home_view.h ('k') | athena/home/home_card_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/bottom_home_view.cc
diff --git a/athena/home/bottom_home_view.cc b/athena/home/bottom_home_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c05bbf496e8453481b6dd41917232ba3dffff040
--- /dev/null
+++ b/athena/home/bottom_home_view.cc
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "athena/home/bottom_home_view.h"
+
+#include "ui/app_list/app_list_item_list.h"
+#include "ui/app_list/app_list_model.h"
+#include "ui/app_list/app_list_view_delegate.h"
+#include "ui/app_list/views/search_box_view.h"
+#include "ui/app_list/views/tile_item_view.h"
+#include "ui/views/background.h"
+#include "ui/views/border.h"
+#include "ui/views/layout/box_layout.h"
+
+namespace athena {
+
+BottomHomeView::BottomHomeView(app_list::AppListViewDelegate* view_delegate)
+ : view_delegate_(view_delegate) {
+ set_background(views::Background::CreateSolidBackground(SK_ColorWHITE));
+ SetBorder(views::Border::CreateSolidBorder(1, SK_ColorBLACK));
+ SetLayoutManager(new views::BoxLayout(
+ views::BoxLayout::kVertical, 0, 0, 0));
+
+ app_list::AppListModel* model = view_delegate->GetModel();
+ app_list::AppListItemList* top_level = model->top_level_item_list();
+
+ views::View* items_container = new views::View();
+ AddChildView(items_container);
+
+ views::BoxLayout* items_layout = new views::BoxLayout(
+ views::BoxLayout::kHorizontal, 0, 0, 0);
+ items_layout->set_main_axis_alignment(
+ views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL);
+ items_container->SetLayoutManager(items_layout);
+ for (size_t i = 0; i < top_level->item_count(); ++i) {
+ app_list::TileItemView* tile_item_view = new app_list::TileItemView();
+ tile_item_view->SetAppListItem(top_level->item_at(i));
+ items_container->AddChildView(tile_item_view);
+ }
+
+ app_list::SearchBoxView* search_box = new app_list::SearchBoxView(
+ this, view_delegate);
+ AddChildView(search_box);
+}
+
+BottomHomeView::~BottomHomeView() {}
+
+void BottomHomeView::QueryChanged(app_list::SearchBoxView* sender) {
+ // Nothing needs to be done.
+}
+
+} // namespace athena
« no previous file with comments | « athena/home/bottom_home_view.h ('k') | athena/home/home_card_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698