OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_VOLUME_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_VOLUME_MENU_BUTTON_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_VOLUME_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_VOLUME_MENU_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/chromeos/audio/audio_handler.h" | 10 #include "chrome/browser/chromeos/audio/audio_handler.h" |
11 #include "chrome/browser/chromeos/status/status_area_button.h" | 11 #include "chrome/browser/chromeos/status/status_area_button.h" |
12 #include "ui/views/controls/button/menu_button_delegate.h" | 12 #include "ui/views/controls/button/menu_button_listener.h" |
13 #include "ui/views/controls/menu/menu_delegate.h" | 13 #include "ui/views/controls/menu/menu_delegate.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 // The volume button in the status area. | 17 // The volume button in the status area. |
18 class VolumeMenuButton : public StatusAreaButton, | 18 class VolumeMenuButton : public StatusAreaButton, |
19 public views::MenuDelegate, | 19 public views::MenuDelegate, |
20 public views::MenuButtonDelegate, | 20 public views::MenuButtonListener, |
21 public AudioHandler::VolumeObserver { | 21 public AudioHandler::VolumeObserver { |
22 public: | 22 public: |
23 explicit VolumeMenuButton(StatusAreaButton::Delegate* delegate); | 23 explicit VolumeMenuButton(StatusAreaButton::Delegate* delegate); |
24 virtual ~VolumeMenuButton(); | 24 virtual ~VolumeMenuButton(); |
25 | 25 |
26 // Update the volume icon. | 26 // Update the volume icon. |
27 void UpdateIcon(); | 27 void UpdateIcon(); |
28 | 28 |
29 protected: | 29 protected: |
30 // StatusAreaButton implementation. | 30 // StatusAreaButton implementation. |
31 virtual int icon_width() OVERRIDE; | 31 virtual int icon_width() OVERRIDE; |
32 | 32 |
33 private: | 33 private: |
34 // views::View implementation. | 34 // views::View implementation. |
35 virtual void OnLocaleChanged() OVERRIDE; | 35 virtual void OnLocaleChanged() OVERRIDE; |
36 | 36 |
37 // views::MenuButtonDelegate implementation. | 37 // views::MenuButtonListener implementation. |
38 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; | 38 virtual void OnMenuButtonClicked(views::View* source, |
| 39 const gfx::Point& point) OVERRIDE; |
39 | 40 |
40 // AudioHandler::VolumeObserver implementation. | 41 // AudioHandler::VolumeObserver implementation. |
41 virtual void OnVolumeChanged() OVERRIDE; | 42 virtual void OnVolumeChanged() OVERRIDE; |
42 | 43 |
43 DISALLOW_COPY_AND_ASSIGN(VolumeMenuButton); | 44 DISALLOW_COPY_AND_ASSIGN(VolumeMenuButton); |
44 }; | 45 }; |
45 | 46 |
46 } // namespace chromeos | 47 } // namespace chromeos |
47 | 48 |
48 #endif // CHROME_BROWSER_CHROMEOS_STATUS_VOLUME_MENU_BUTTON_H_ | 49 #endif // CHROME_BROWSER_CHROMEOS_STATUS_VOLUME_MENU_BUTTON_H_ |
OLD | NEW |