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.
5 #ifndef ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_
6 #define ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_
8 #include "ui/views/view.h"
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
{
16 TrayPopupItemContainer(views::View
* view
,
17 bool change_background
,
20 ~TrayPopupItemContainer() override
;
27 // Sets whether the active background is to be used, and triggers a paint.
28 void SetActive(bool active
);
31 void ChildVisibilityChanged(views::View
* child
) override
;
32 void ChildPreferredSizeChanged(views::View
* child
) override
;
33 void OnMouseEntered(const ui::MouseEvent
& event
) override
;
34 void OnMouseExited(const ui::MouseEvent
& event
) override
;
35 void OnGestureEvent(ui::GestureEvent
* event
) override
;
36 void OnPaintBackground(gfx::Canvas
* canvas
) override
;
38 // True if either a mouse is hovering over this view, or if a user has touched
42 // True if mouse hover and touch feedback can alter the background color of
44 bool change_background_
;
46 DISALLOW_COPY_AND_ASSIGN(TrayPopupItemContainer
);
51 #endif // ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_