Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 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 #ifndef ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_ | |
| 6 #define ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_ | |
| 7 | |
| 8 #include "ui/views/view.h" | |
| 9 | |
| 10 namespace ash { | |
| 11 | |
| 12 // A view which can optionally change the background color when a mouse is | |
| 13 // hovering or a user is interacting via touch. | |
| 14 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
| |
| 15 public: | |
| 16 TrayPopupItemContainer(views::View* view, | |
| 17 bool change_background, | |
| 18 bool draw_border); | |
| 19 | |
| 20 virtual ~TrayPopupItemContainer(); | |
| 21 | |
| 22 bool active() { | |
| 23 return active_; | |
| 24 } | |
| 25 | |
| 26 private: | |
| 27 // Sets whether the active background is to be used, and triggers a paint. | |
| 28 void SetActive(bool active); | |
| 29 | |
| 30 // views::View: | |
| 31 virtual void ChildVisibilityChanged(views::View* child) OVERRIDE; | |
| 32 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE; | |
| 33 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | |
| 34 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | |
| 35 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | |
| 36 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE; | |
| 37 | |
| 38 // True if either a mouse is hovering over this view, or if a user has touched | |
| 39 // down. | |
| 40 bool active_; | |
| 41 | |
| 42 // True if mouse hover and touch feedback can alter the background color of | |
| 43 // the container. | |
| 44 bool change_background_; | |
| 45 | |
| 46 // True if touch view feedback command line flag has been enabled. When | |
| 47 // enabled touch gestures will toggle rendering the background as active. | |
| 48 bool touch_feedback_enabled_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(TrayPopupItemContainer); | |
| 51 }; | |
| 52 | |
| 53 } // namespace ash | |
| 54 | |
| 55 #endif // ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_ | |
| OLD | NEW |