| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_VOLUME_MENU_BUTTON_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_STATUS_VOLUME_MENU_BUTTON_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "chrome/browser/chromeos/audio/audio_handler.h" | |
| 11 #include "chrome/browser/chromeos/status/status_area_button.h" | |
| 12 #include "ui/views/controls/button/menu_button_listener.h" | |
| 13 #include "ui/views/controls/menu/menu_delegate.h" | |
| 14 | |
| 15 namespace chromeos { | |
| 16 | |
| 17 // The volume button in the status area. | |
| 18 class VolumeMenuButton : public StatusAreaButton, | |
| 19 public views::MenuDelegate, | |
| 20 public views::MenuButtonListener, | |
| 21 public AudioHandler::VolumeObserver { | |
| 22 public: | |
| 23 explicit VolumeMenuButton(StatusAreaButton::Delegate* delegate); | |
| 24 virtual ~VolumeMenuButton(); | |
| 25 | |
| 26 // Update the volume icon. | |
| 27 void UpdateIcon(); | |
| 28 | |
| 29 protected: | |
| 30 // StatusAreaButton implementation. | |
| 31 virtual int icon_width() OVERRIDE; | |
| 32 | |
| 33 private: | |
| 34 // views::View implementation. | |
| 35 virtual void OnLocaleChanged() OVERRIDE; | |
| 36 | |
| 37 // views::MenuButtonListener implementation. | |
| 38 virtual void OnMenuButtonClicked(views::View* source, | |
| 39 const gfx::Point& point) OVERRIDE; | |
| 40 | |
| 41 // AudioHandler::VolumeObserver implementation. | |
| 42 virtual void OnVolumeChanged() OVERRIDE; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(VolumeMenuButton); | |
| 45 }; | |
| 46 | |
| 47 } // namespace chromeos | |
| 48 | |
| 49 #endif // CHROME_BROWSER_CHROMEOS_STATUS_VOLUME_MENU_BUTTON_H_ | |
| OLD | NEW |