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

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: Created 6 years, 3 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: 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..36690c5b8ab1bed1a4c6733c4f43b5f20e7d2f0b
--- /dev/null
+++ b/ash/system/tray/tray_popup_item_container.h
@@ -0,0 +1,55 @@
+// 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 {
flackr 2014/09/10 22:54:32 Can you get this and/or the .cc file to show up as
jonross 2014/09/11 15:53:23 I ran this but it still shows as added
+ 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_;
+
+ // True if touch view feedback command line flag has been enabled. When
+ // enabled touch gestures will toggle rendering the background as active.
+ bool touch_feedback_enabled_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrayPopupItemContainer);
+};
+
+} // namespace ash
+
+#endif // ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_

Powered by Google App Engine
This is Rietveld 408576698