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

Side by Side Diff: views/controls/native_control.h

Issue 3354005: Re-lands 58186: (Closed)
Patch Set: Created 10 years, 3 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 unified diff | Download patch
« no previous file with comments | « views/controls/menu/native_menu_win.cc ('k') | views/controls/native_control.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_NATIVE_CONTROL_H_ 5 #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_H_
6 #define VIEWS_CONTROLS_NATIVE_CONTROL_H_ 6 #define VIEWS_CONTROLS_NATIVE_CONTROL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <windows.h> 9 #include <windows.h>
10 10
11 #include "base/keyboard_codes.h" 11 #include "app/keyboard_codes.h"
12 #include "views/view.h" 12 #include "views/view.h"
13 13
14 namespace views { 14 namespace views {
15 15
16 class NativeViewHost; 16 class NativeViewHost;
17 class NativeControlContainer; 17 class NativeControlContainer;
18 18
19 //////////////////////////////////////////////////////////////////////////////// 19 ////////////////////////////////////////////////////////////////////////////////
20 // 20 //
21 // NativeControl is an abstract view that is used to implement views wrapping 21 // NativeControl is an abstract view that is used to implement views wrapping
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // Overridden so that the control properly reflects parent's visibility. 74 // Overridden so that the control properly reflects parent's visibility.
75 virtual void VisibilityChanged(View* starting_from, bool is_visible); 75 virtual void VisibilityChanged(View* starting_from, bool is_visible);
76 76
77 // Controls that have fixed sizes should call these methods to specify the 77 // Controls that have fixed sizes should call these methods to specify the
78 // actual size and how they should be aligned within their parent. 78 // actual size and how they should be aligned within their parent.
79 void SetFixedWidth(int width, Alignment alignment); 79 void SetFixedWidth(int width, Alignment alignment);
80 void SetFixedHeight(int height, Alignment alignment); 80 void SetFixedHeight(int height, Alignment alignment);
81 81
82 // Invoked when a key is pressed on the control. 82 // Invoked when a key is pressed on the control.
83 // Should return true if the key message was processed, false otherwise. 83 // Should return true if the key message was processed, false otherwise.
84 virtual bool OnKeyDown(base::KeyboardCode virtual_key_code) { return false; } 84 virtual bool OnKeyDown(app::KeyboardCode virtual_key_code) { return false; }
85 85
86 // Returns additional extended style flags. When subclasses call 86 // Returns additional extended style flags. When subclasses call
87 // CreateWindowEx in order to create the underlying control, they must OR the 87 // CreateWindowEx in order to create the underlying control, they must OR the
88 // ExStyle parameter with the value returned by this function. 88 // ExStyle parameter with the value returned by this function.
89 // 89 //
90 // We currently use this method in order to add flags such as WS_EX_LAYOUTRTL 90 // We currently use this method in order to add flags such as WS_EX_LAYOUTRTL
91 // to the HWND for views with right-to-left UI layout. 91 // to the HWND for views with right-to-left UI layout.
92 DWORD GetAdditionalExStyle() const; 92 DWORD GetAdditionalExStyle() const;
93 93
94 // TODO(xji): we use the following temporary function as we transition the 94 // TODO(xji): we use the following temporary function as we transition the
(...skipping 21 matching lines...) Expand all
116 WPARAM w_param, LPARAM l_param); 116 WPARAM w_param, LPARAM l_param);
117 117
118 NativeControlContainer* container_; 118 NativeControlContainer* container_;
119 119
120 DISALLOW_COPY_AND_ASSIGN(NativeControl); 120 DISALLOW_COPY_AND_ASSIGN(NativeControl);
121 }; 121 };
122 122
123 } // namespace views 123 } // namespace views
124 124
125 #endif // VIEWS_CONTROLS_NATIVE_CONTROL_H_ 125 #endif // VIEWS_CONTROLS_NATIVE_CONTROL_H_
OLDNEW
« no previous file with comments | « views/controls/menu/native_menu_win.cc ('k') | views/controls/native_control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698