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

Side by Side Diff: athena/home/home_card_delegate_view.cc

Issue 287253003: Add initial home card impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/home_card_delegate_view.h ('k') | athena/home/home_card_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "athena/home/home_card_delegate_view.h"
6
7 #include "ui/views/background.h"
8 #include "ui/views/border.h"
9 #include "ui/views/widget/widget.h"
10
11 namespace athena {
12
13 HomeCardDelegateView::HomeCardDelegateView() {
14 const SkColor kHomeTopColor = 0xDDFFFFFF;
15 const SkColor kHomeBottomColor = 0xAAEEEEEE;
16 const SkColor kHomeBorderColor = 0xDDFFFFFF;
17 set_background(views::Background::CreateVerticalGradientBackground(
18 kHomeTopColor, kHomeBottomColor));
19 scoped_ptr<views::Border> border(
20 views::Border::CreateSolidBorder(5, kHomeBorderColor));
21 SetBorder(border.Pass());
22 }
23
24 HomeCardDelegateView::~HomeCardDelegateView() {
25 }
26
27 void HomeCardDelegateView::OnMouseEvent(ui::MouseEvent* event) {
28 // Temp code to test animation.
29 if (event->type() == ui::ET_MOUSE_PRESSED) {
30 views::Widget* widget = GetWidget();
31 if (widget->IsVisible())
32 widget->Hide();
33 }
34 }
35
36 void HomeCardDelegateView::DeleteDelegate() {
37 delete this;
38 }
39
40 views::Widget* HomeCardDelegateView::GetWidget() {
41 return views::View::GetWidget();
42 }
43
44 const views::Widget* HomeCardDelegateView::GetWidget() const {
45 return views::View::GetWidget();
46 }
47
48 views::View* HomeCardDelegateView::GetContentsView() {
49 return this;
50 }
51
52 } // namespace athena
OLDNEW
« no previous file with comments | « athena/home/home_card_delegate_view.h ('k') | athena/home/home_card_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698