1 // Copyright 2013 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_SHELF_ALTERNATE_APP_LIST_BUTTON_H_
6 #define ASH_SHELF_ALTERNATE_APP_LIST_BUTTON_H_
8 #include "ui/views/controls/button/image_button.h"
16 class LauncherButtonHost
;
18 // Button used for the AppList icon on the launcher.
19 // This class is an alternate implementation to
20 // ash::internal::AppListButton for the purposes of testing an
21 // alternate shelf layout (see ash_switches: UseAlternateShelfLayout).
22 class AlternateAppListButton
: public views::ImageButton
{
24 // Bounds size (inset) required for the app icon image (in pixels).
25 static const int kImageBoundsSize
;
27 AlternateAppListButton(views::ButtonListener
* listener
,
28 LauncherButtonHost
* host
,
29 ShelfWidget
* shelf_widget
);
30 virtual ~AlternateAppListButton();
33 // views::ImageButton overrides:
34 virtual bool OnMousePressed(const ui::MouseEvent
& event
) OVERRIDE
;
35 virtual void OnMouseReleased(const ui::MouseEvent
& event
) OVERRIDE
;
36 virtual void OnMouseCaptureLost() OVERRIDE
;
37 virtual bool OnMouseDragged(const ui::MouseEvent
& event
) OVERRIDE
;
38 virtual void OnMouseMoved(const ui::MouseEvent
& event
) OVERRIDE
;
39 virtual void OnMouseEntered(const ui::MouseEvent
& event
) OVERRIDE
;
40 virtual void OnMouseExited(const ui::MouseEvent
& event
) OVERRIDE
;
41 virtual void OnPaint(gfx::Canvas
* canvas
) OVERRIDE
;
42 virtual void GetAccessibleState(ui::AccessibleViewState
* state
) OVERRIDE
;
44 // ui::EventHandler overrides:
45 virtual void OnGestureEvent(ui::GestureEvent
* event
) OVERRIDE
;
48 LauncherButtonHost
* host_
;
49 // Reference to the shelf widget containing this button, owned by the
50 // root window controller.
51 ShelfWidget
* shelf_widget_
;
53 DISALLOW_COPY_AND_ASSIGN(AlternateAppListButton
);
56 } // namespace internal
59 #endif // ASH_SHELF_ALTERNATE_APP_LIST_BUTTON_H_