Index: ash/system/fractional_view/scale_view.h |
diff --git a/ash/system/fractional_view/scale_view.h b/ash/system/fractional_view/scale_view.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..76c64b94d95ca9ad0ce52e11e3a22f4da101ff34 |
--- /dev/null |
+++ b/ash/system/fractional_view/scale_view.h |
@@ -0,0 +1,63 @@ |
+ |
+// Copyright 2017 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_SYSTEM_FRACTIONAL_SCALE_VIEW_H_ |
+#define ASH_SYSTEM_FRACTIONAL_SCALE_VIEW_H_ |
+ |
+#include "base/macros.h" |
+#include "ui/views/controls/button/button.h" |
+#include "ui/views/controls/slider.h" |
+#include "ui/views/view.h" |
+ |
+namespace views { |
+class CustomButton; |
+class Label; |
+} |
+ |
+namespace ash { |
+class SystemTrayItem; |
+class TriView; |
+ |
+namespace tray { |
+class ScaleView : public views::View, |
+ public views::SliderListener, |
+ public views::ButtonListener { |
+ public: |
+ ScaleView(SystemTrayItem* owner, bool is_default_view); |
+ |
+ ~ScaleView() override; |
+ |
+ void Update(); |
+ |
+ // Sets volume level on slider_, |percent| is ranged from [0.00] to [1.00]. |
+ void SetScaleLevel(float value); |
+ |
+ private: |
+ // SliderListener: |
+ void SliderValueChanged(views::Slider* sender, |
+ float value, |
+ float old_value, |
+ views::SliderChangeReason reason) override; |
+ void SliderDragEnded(views::Slider* sender) override; |
+ |
+ // views::ButtonListener: |
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
+ |
+ SystemTrayItem* owner_; |
+ // The only immediate child view of |this|. All other view elements are added |
+ // to the |tri_view_| to handle layout. |
+ TriView* tri_view_; |
+ views::CustomButton* more_button_; |
+ views::Label* label_; |
+ views::Slider* slider_; |
+ bool is_default_view_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ScaleView); |
+}; |
+ |
+} // namespace tray |
+} // namespace ash |
+ |
+#endif // ASH_SYSTEM_FRACTIONAL_SCALE_VIEW_H_ |