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

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
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..36044c479d775aa6e6b184c7d1dbcf2ee8f097ad
--- /dev/null
+++ b/athena/home/home_card_delegate_view.cc
@@ -0,0 +1,52 @@
+// 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;
+ const SkColor kHomeBottomColor = 0xAAEEEEEE;
+ const SkColor kHomeBorderColor = 0xDDFFFFFF;
+ set_background(views::Background::CreateVerticalGradientBackground(
+ kHomeTopColor, kHomeBottomColor));
+ scoped_ptr<views::Border> border(
+ views::Border::CreateSolidBorder(5, kHomeBorderColor));
+ 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
« 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