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

Unified Diff: ash/system/tray/tray_popup_item_container.h

Issue 556383002: Status Panel Touch Feedback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restrict test to ChromeOS Created 6 years, 2 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 | « ash/system/tray/tray_details_view_unittest.cc ('k') | ash/system/tray/tray_popup_item_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_popup_item_container.h
diff --git a/ash/system/tray/tray_popup_item_container.h b/ash/system/tray/tray_popup_item_container.h
new file mode 100644
index 0000000000000000000000000000000000000000..8992b2161dd6b855032f3576a0e8cc1d767f3b3f
--- /dev/null
+++ b/ash/system/tray/tray_popup_item_container.h
@@ -0,0 +1,51 @@
+// Copyright (c) 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.
+
+#ifndef ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_
+#define ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_
+
+#include "ui/views/view.h"
+
+namespace ash {
+
+// A view which can optionally change the background color when a mouse is
+// hovering or a user is interacting via touch.
+class TrayPopupItemContainer : public views::View {
+ public:
+ TrayPopupItemContainer(views::View* view,
+ bool change_background,
+ bool draw_border);
+
+ virtual ~TrayPopupItemContainer();
+
+ bool active() {
+ return active_;
+ }
+
+ private:
+ // Sets whether the active background is to be used, and triggers a paint.
+ void SetActive(bool active);
+
+ // views::View:
+ virtual void ChildVisibilityChanged(views::View* child) override;
+ virtual void ChildPreferredSizeChanged(views::View* child) override;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) override;
+ virtual void OnMouseExited(const ui::MouseEvent& event) override;
+ virtual void OnGestureEvent(ui::GestureEvent* event) override;
+ virtual void OnPaintBackground(gfx::Canvas* canvas) override;
+
+ // True if either a mouse is hovering over this view, or if a user has touched
+ // down.
+ bool active_;
+
+ // True if mouse hover and touch feedback can alter the background color of
+ // the container.
+ bool change_background_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrayPopupItemContainer);
+};
+
+} // namespace ash
+
+#endif // ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_
« no previous file with comments | « ash/system/tray/tray_details_view_unittest.cc ('k') | ash/system/tray/tray_popup_item_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698