summaryrefslogtreecommitdiffstats
path: root/ash/launcher/app_list_button.h
blob: 4d1cd63bd660f52c18dc05f6e1c46033b9612e8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2012 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_LAUNCHER_APP_LIST_BUTTON_H_
#define ASH_LAUNCHER_APP_LIST_BUTTON_H_

#include "ash/wm/app_list_controller_observer.h"
#include "ui/views/controls/button/image_button.h"

namespace ash {
namespace internal {

class LauncherButtonHost;

// Button used for the AppList icon on the launcher.
class AppListButton : public views::ToggleImageButton,
                      public AppListControllerObserver {
 public:
  AppListButton(views::ButtonListener* listener,
                LauncherButtonHost* host);
  virtual ~AppListButton();

  void StartLoadingAnimation();
  void StopLoadingAnimation();

 protected:
  // View overrides:
  virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
  virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
  virtual void OnMouseCaptureLost() OVERRIDE;
  virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
  virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE;
  virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
  virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
  virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;

 private:
  // AppListControllerObserver overrides:
  virtual void OnAppLauncherVisibilityChanged(
      bool visible,
      const aura::RootWindow* root_window) OVERRIDE;

  LauncherButtonHost* host_;

  DISALLOW_COPY_AND_ASSIGN(AppListButton);
};

}  // namespace internal
}  // namespace ash

#endif  // ASH_LAUNCHER_APP_LIST_BUTTON_H_