Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_VIEWS_CONTROLS_SEPARATOR_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SEPARATOR_H_ |
| 6 #define UI_VIEWS_CONTROLS_SEPARATOR_H_ | 6 #define UI_VIEWS_CONTROLS_SEPARATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 | 13 |
| 14 // The Separator class is a view that shows a line used to visually separate | 14 // The Separator class is a view that shows a line used to visually separate |
| 15 // other views. | 15 // other views. |
| 16 | 16 |
| 17 class VIEWS_EXPORT Separator : public View { | 17 class VIEWS_EXPORT Separator : public View { |
| 18 public: | 18 public: |
| 19 enum Orientation { | 19 enum Orientation { |
| 20 HORIZONTAL, | 20 HORIZONTAL, |
| 21 VERTICAL | 21 VERTICAL |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 // The separator's class name. | 24 // The separator's class name. |
| 25 static const char kViewClassName[]; | 25 static const char kViewClassName[]; |
| 26 | 26 |
| 27 explicit Separator(Orientation orientation); | 27 explicit Separator(Orientation orientation); |
| 28 Separator(Orientation orientation, SkColor color); | |
|
sky
2014/11/18 18:04:06
We generally don't have constructors like this. At
melandory
2014/11/18 19:12:47
Done.
| |
| 29 Separator(Orientation orientation, SkColor color, int height); | |
| 30 | |
| 28 ~Separator() override; | 31 ~Separator() override; |
| 29 | 32 |
| 30 // Overridden from View: | 33 // Overridden from View: |
| 31 gfx::Size GetPreferredSize() const override; | 34 gfx::Size GetPreferredSize() const override; |
| 32 void GetAccessibleState(ui::AXViewState* state) override; | 35 void GetAccessibleState(ui::AXViewState* state) override; |
| 33 void Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) override; | 36 void Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) override; |
| 34 const char* GetClassName() const override; | 37 const char* GetClassName() const override; |
| 35 | 38 |
| 36 private: | 39 private: |
| 37 const Orientation orientation_; | 40 const Orientation orientation_; |
| 41 const SkColor color_; | |
| 42 const int height_; | |
| 38 | 43 |
| 39 DISALLOW_COPY_AND_ASSIGN(Separator); | 44 DISALLOW_COPY_AND_ASSIGN(Separator); |
| 40 }; | 45 }; |
| 41 | 46 |
| 42 } // namespace views | 47 } // namespace views |
| 43 | 48 |
| 44 #endif // UI_VIEWS_CONTROLS_SEPARATOR_H_ | 49 #endif // UI_VIEWS_CONTROLS_SEPARATOR_H_ |
| OLD | NEW |