Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Unified Diff: ash/system/fractional_view/scale_view.h

Issue 2849953004: SV Test
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/fractional_view/scale_detailed_view.cc ('k') | ash/system/fractional_view/scale_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ash/system/fractional_view/scale_detailed_view.cc ('k') | ash/system/fractional_view/scale_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698