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

Side by Side Diff: ash/common/system/tray/tray_popup_item_container.h

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 9 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 unified diff | Download patch
OLDNEW
(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_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_
6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_
7
8 #include "base/macros.h"
9 #include "ui/views/view.h"
10
11 namespace ash {
12
13 // A view which can optionally change the background color when a mouse is
14 // hovering or a user is interacting via touch.
15 class TrayPopupItemContainer : public views::View {
16 public:
17 TrayPopupItemContainer(views::View* view, bool change_background);
18
19 ~TrayPopupItemContainer() override;
20
21 bool active() { return active_; }
22
23 private:
24 // Sets whether the active background is to be used, and triggers a paint.
25 void SetActive(bool active);
26
27 // views::View:
28 void ChildVisibilityChanged(views::View* child) override;
29 void ChildPreferredSizeChanged(views::View* child) override;
30 void OnMouseEntered(const ui::MouseEvent& event) override;
31 void OnMouseExited(const ui::MouseEvent& event) override;
32 void OnGestureEvent(ui::GestureEvent* event) override;
33 void OnPaintBackground(gfx::Canvas* canvas) override;
34
35 // True if either a mouse is hovering over this view, or if a user has touched
36 // down.
37 bool active_;
38
39 // True if mouse hover and touch feedback can alter the background color of
40 // the container.
41 bool change_background_;
42
43 DISALLOW_COPY_AND_ASSIGN(TrayPopupItemContainer);
44 };
45
46 } // namespace ash
47
48 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_CONTAINER_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_popup_ink_drop_style.h ('k') | ash/common/system/tray/tray_popup_item_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698