| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_VOLUME_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_VOLUME_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_VOLUME_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_VOLUME_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/views/controls/button/button.h" | 9 #include "ui/views/controls/button/button.h" |
| 10 #include "ui/views/controls/slider.h" | 10 #include "ui/views/controls/slider.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 ~VolumeView() override; | 39 ~VolumeView() override; |
| 40 | 40 |
| 41 void Update(); | 41 void Update(); |
| 42 | 42 |
| 43 // Sets volume level on slider_, |percent| is ranged from [0.00] to [1.00]. | 43 // Sets volume level on slider_, |percent| is ranged from [0.00] to [1.00]. |
| 44 void SetVolumeLevel(float percent); | 44 void SetVolumeLevel(float percent); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // Updates device_type_ icon and more_ button. | 47 // Updates device_type_ icon and more_ button. |
| 48 void UpdateDeviceTypeAndMore(); | 48 void UpdateDeviceTypeAndMore(); |
| 49 void HandleVolumeUp(float percent); | 49 void HandleVolumeUp(int percent); |
| 50 void HandleVolumeDown(float percent); | 50 void HandleVolumeDown(int percent); |
| 51 | 51 |
| 52 // SliderListener: | 52 // SliderListener: |
| 53 void SliderValueChanged(views::Slider* sender, | 53 void SliderValueChanged(views::Slider* sender, |
| 54 float value, | 54 float value, |
| 55 float old_value, | 55 float old_value, |
| 56 views::SliderChangeReason reason) override; | 56 views::SliderChangeReason reason) override; |
| 57 | 57 |
| 58 // views::ButtonListener: | 58 // views::ButtonListener: |
| 59 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 59 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 60 | 60 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 74 views::ImageView* device_type_; | 74 views::ImageView* device_type_; |
| 75 bool is_default_view_; | 75 bool is_default_view_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(VolumeView); | 77 DISALLOW_COPY_AND_ASSIGN(VolumeView); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace tray | 80 } // namespace tray |
| 81 } // namespace ash | 81 } // namespace ash |
| 82 | 82 |
| 83 #endif // ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_VOLUME_VIEW_H_ | 83 #endif // ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_VOLUME_VIEW_H_ |
| OLD | NEW |