summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/toolbar/wrench_toolbar_button.h
blob: 697164dd4e406ed4ffc9f7a4de10e0229acb0c79 (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
// Copyright 2013 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 CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_TOOLBAR_BUTTON_H_
#define CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_TOOLBAR_BUTTON_H_

#include "chrome/browser/ui/toolbar/wrench_icon_painter.h"
#include "ui/views/controls/button/menu_button.h"

// TODO(gbillock): Rename this? No longer a wrench.
class WrenchToolbarButton : public views::MenuButton,
                            public WrenchIconPainter::Delegate {
 public:
  explicit WrenchToolbarButton(views::MenuButtonListener* menu_button_listener);
  virtual ~WrenchToolbarButton();

  void SetSeverity(WrenchIconPainter::Severity severity, bool animate);

 private:
  // views::MenuButton:
  virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;

  // WrenchIconPainter::Delegate:
  virtual void ScheduleWrenchIconPaint() OVERRIDE;

  WrenchIconPainter::BezelType GetCurrentBezelType() const;

  scoped_ptr<WrenchIconPainter> wrench_icon_painter_;

  DISALLOW_COPY_AND_ASSIGN(WrenchToolbarButton);
};

#endif  // CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_TOOLBAR_BUTTON_H_