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