OLD | NEW |
---|---|
(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; | |
Mr4D (OOO till 08-26)
2014/05/22 20:53:28
Could you please move these constants out into the
Mr4D (OOO till 08-26)
2014/05/22 22:19:15
Again - extracting them in one point feels like a
oshima
2014/05/23 14:54:37
Well, this code is pure place holder, and the colo
Mr4D (OOO till 08-26)
2014/05/23 15:29:26
We will have colors and we will get more. Even if
| |
15 const SkColor kHomeBottomColor = 0xAAEEEEEE; | |
16 set_background(views::Background::CreateVerticalGradientBackground( | |
17 kHomeTopColor, kHomeBottomColor)); | |
18 scoped_ptr<views::Border> border( | |
19 views::Border::CreateSolidBorder(5, 0xDDFFFFFF)); | |
20 SetBorder(border.Pass()); | |
21 } | |
22 | |
23 HomeCardDelegateView::~HomeCardDelegateView() { | |
24 } | |
25 | |
26 void HomeCardDelegateView::OnMouseEvent(ui::MouseEvent* event) { | |
27 // Temp code to test animation. | |
28 if (event->type() == ui::ET_MOUSE_PRESSED) { | |
29 views::Widget* widget = GetWidget(); | |
30 if (widget->IsVisible()) | |
31 widget->Hide(); | |
32 } | |
33 } | |
34 | |
35 void HomeCardDelegateView::DeleteDelegate() { | |
36 delete this; | |
37 } | |
38 | |
39 views::Widget* HomeCardDelegateView::GetWidget() { | |
40 return views::View::GetWidget(); | |
41 } | |
42 | |
43 const views::Widget* HomeCardDelegateView::GetWidget() const { | |
44 return views::View::GetWidget(); | |
45 } | |
46 | |
47 views::View* HomeCardDelegateView::GetContentsView() { | |
48 return this; | |
49 } | |
50 | |
51 } // namespace athena | |
OLD | NEW |