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

Side by Side Diff: athena/home/minimized_home.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « athena/home/minimized_home.h ('k') | athena/main/athena_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/minimized_home.h" 5 #include "athena/home/minimized_home.h"
6 6
7 #include "ui/views/background.h" 7 #include "ui/views/background.h"
8 #include "ui/views/layout/box_layout.h" 8 #include "ui/views/layout/box_layout.h"
9 #include "ui/views/view.h" 9 #include "ui/views/view.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 athena::MinimizedHomeDragDelegate* delegate_; 86 athena::MinimizedHomeDragDelegate* delegate_;
87 SkColor color_; 87 SkColor color_;
88 88
89 DISALLOW_COPY_AND_ASSIGN(MinimizedHomeView); 89 DISALLOW_COPY_AND_ASSIGN(MinimizedHomeView);
90 }; 90 };
91 91
92 } // namespace 92 } // namespace
93 93
94 namespace athena { 94 namespace athena {
95 95
96 views::Widget* CreateMinimizedHome(aura::Window* container, 96 views::View* CreateMinimizedHome(MinimizedHomeDragDelegate* delegate) {
97 MinimizedHomeDragDelegate* delegate) {
98 views::Widget* widget = new views::Widget;
99 views::Widget::InitParams params(
100 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
101 params.parent = container;
102 params.delegate = NULL;
103 widget->Init(params);
104
105 views::View* content_view = new views::View; 97 views::View* content_view = new views::View;
106 widget->SetContentsView(content_view); 98 content_view->set_background(
99 views::Background::CreateSolidBackground(SK_ColorBLACK));
107 views::BoxLayout* layout = 100 views::BoxLayout* layout =
108 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 2, 0); 101 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 2, 0);
109 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER); 102 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
110 content_view->SetLayoutManager(layout); 103 content_view->SetLayoutManager(layout);
111 104
112 views::View* view = new MinimizedHomeView(delegate); 105 views::View* view = new MinimizedHomeView(delegate);
113 content_view->AddChildView(view); 106 content_view->AddChildView(view);
114 return widget; 107 return content_view;
115 } 108 }
116 109
117 } // namespace athena 110 } // namespace athena
OLDNEW
« no previous file with comments | « athena/home/minimized_home.h ('k') | athena/main/athena_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698