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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: athena/home/home_card_delegate_view.cc
diff --git a/athena/home/home_card_delegate_view.cc b/athena/home/home_card_delegate_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..45c6302f49a39431da73db7060ae169707c3d869
--- /dev/null
+++ b/athena/home/home_card_delegate_view.cc
@@ -0,0 +1,51 @@
+// 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/home_card_delegate_view.h"
+
+#include "ui/views/background.h"
+#include "ui/views/border.h"
+#include "ui/views/widget/widget.h"
+
+namespace athena {
+
+HomeCardDelegateView::HomeCardDelegateView() {
+ 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
+ const SkColor kHomeBottomColor = 0xAAEEEEEE;
+ set_background(views::Background::CreateVerticalGradientBackground(
+ kHomeTopColor, kHomeBottomColor));
+ scoped_ptr<views::Border> border(
+ views::Border::CreateSolidBorder(5, 0xDDFFFFFF));
+ SetBorder(border.Pass());
+}
+
+HomeCardDelegateView::~HomeCardDelegateView() {
+}
+
+void HomeCardDelegateView::OnMouseEvent(ui::MouseEvent* event) {
+ // Temp code to test animation.
+ if (event->type() == ui::ET_MOUSE_PRESSED) {
+ views::Widget* widget = GetWidget();
+ if (widget->IsVisible())
+ widget->Hide();
+ }
+}
+
+void HomeCardDelegateView::DeleteDelegate() {
+ delete this;
+}
+
+views::Widget* HomeCardDelegateView::GetWidget() {
+ return views::View::GetWidget();
+}
+
+const views::Widget* HomeCardDelegateView::GetWidget() const {
+ return views::View::GetWidget();
+}
+
+views::View* HomeCardDelegateView::GetContentsView() {
+ return this;
+}
+
+} // namespace athena

Powered by Google App Engine
This is Rietveld 408576698