OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 VIEWS_CONTROLS_SEPARATOR_H_ | 5 #ifndef VIEWS_CONTROLS_SEPARATOR_H_ |
6 #define VIEWS_CONTROLS_SEPARATOR_H_ | 6 #define VIEWS_CONTROLS_SEPARATOR_H_ |
7 | 7 |
8 #include "views/controls/native_control.h" | 8 #include <string> |
| 9 |
| 10 #include "views/view.h" |
9 | 11 |
10 namespace views { | 12 namespace views { |
11 | 13 |
12 // 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 |
13 // other views. The current implementation is only horizontal. | 15 // other views. The current implementation is only horizontal. |
14 | 16 |
15 class Separator : public NativeControl { | 17 class Separator : public View { |
16 public: | 18 public: |
| 19 // The separator's class name. |
| 20 static const char kViewClassName[]; |
| 21 |
17 Separator(); | 22 Separator(); |
18 virtual ~Separator(); | 23 virtual ~Separator(); |
19 | 24 |
20 // NativeControl overrides: | 25 // Overridden from View: |
21 virtual HWND CreateNativeControl(HWND parent_container); | 26 virtual void Layout(); |
22 virtual LRESULT OnNotify(int w_param, LPNMHDR l_param); | |
23 | |
24 // View overrides: | |
25 virtual gfx::Size GetPreferredSize(); | 27 virtual gfx::Size GetPreferredSize(); |
| 28 protected: |
| 29 virtual void ViewHierarchyChanged(bool is_add, View* parent, |
| 30 View* child); |
| 31 virtual std::string GetClassName() const; |
26 | 32 |
27 private: | 33 private: |
| 34 void CreateNativeWrapper(); |
28 | 35 |
29 DISALLOW_EVIL_CONSTRUCTORS(Separator); | 36 // The native view. |
| 37 View* native_wrapper_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(Separator); |
30 }; | 40 }; |
31 | 41 |
32 } // namespace views | 42 } // namespace views |
33 | 43 |
34 #endif // #define VIEWS_CONTROLS_SEPARATOR_H_ | 44 #endif // VIEWS_CONTROLS_SEPARATOR_H_ |
OLD | NEW |