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 VIEWS_WIDGET_WIDGET_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_H_ |
6 #define VIEWS_WIDGET_WIDGET_H_ | 6 #define VIEWS_WIDGET_WIDGET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 class Accelerator; | 26 class Accelerator; |
27 class Compositor; | 27 class Compositor; |
28 class OSExchangeData; | 28 class OSExchangeData; |
29 class ThemeProvider; | 29 class ThemeProvider; |
30 } | 30 } |
31 using ui::ThemeProvider; | 31 using ui::ThemeProvider; |
32 | 32 |
33 namespace views { | 33 namespace views { |
34 | 34 |
35 class DefaultThemeProvider; | 35 class DefaultThemeProvider; |
| 36 class InputMethod; |
36 class NativeWidget; | 37 class NativeWidget; |
37 class RootView; | 38 class RootView; |
38 class TooltipManager; | 39 class TooltipManager; |
39 class View; | 40 class View; |
40 class WidgetDelegate; | 41 class WidgetDelegate; |
41 class Window; | 42 class Window; |
42 | 43 |
43 //////////////////////////////////////////////////////////////////////////////// | 44 //////////////////////////////////////////////////////////////////////////////// |
44 // Widget class | 45 // Widget class |
45 // | 46 // |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 bool IsAccessibleWidget() const; | 212 bool IsAccessibleWidget() const; |
212 | 213 |
213 // Returns the ThemeProvider that provides theme resources for this Widget. | 214 // Returns the ThemeProvider that provides theme resources for this Widget. |
214 virtual ThemeProvider* GetThemeProvider() const; | 215 virtual ThemeProvider* GetThemeProvider() const; |
215 | 216 |
216 // Returns the FocusManager for this widget. | 217 // Returns the FocusManager for this widget. |
217 // Note that all widgets in a widget hierarchy share the same focus manager. | 218 // Note that all widgets in a widget hierarchy share the same focus manager. |
218 // TODO(beng): remove virtual. | 219 // TODO(beng): remove virtual. |
219 virtual FocusManager* GetFocusManager(); | 220 virtual FocusManager* GetFocusManager(); |
220 | 221 |
| 222 // Returns the InputMethod for this widget. |
| 223 // Note that all widgets in a widget hierarchy share the same input method. |
| 224 InputMethod* GetInputMethod() const; |
| 225 |
221 // Returns true if the native view |native_view| is contained in the | 226 // Returns true if the native view |native_view| is contained in the |
222 // views::View hierarchy rooted at this widget. | 227 // views::View hierarchy rooted at this widget. |
223 // TODO(beng): const. | 228 // TODO(beng): const. |
224 bool ContainsNativeView(gfx::NativeView native_view); | 229 bool ContainsNativeView(gfx::NativeView native_view); |
225 | 230 |
226 // Starts a drag operation for the specified view. This blocks until the drag | 231 // Starts a drag operation for the specified view. This blocks until the drag |
227 // operation completes. |view| can be NULL. | 232 // operation completes. |view| can be NULL. |
228 // If the view is non-NULL it can be accessed during the drag by calling | 233 // If the view is non-NULL it can be accessed during the drag by calling |
229 // dragged_view(). If the view has not been deleted during the drag, | 234 // dragged_view(). If the view has not been deleted during the drag, |
230 // OnDragDone() is called on it. | 235 // OnDragDone() is called on it. |
(...skipping 29 matching lines...) Expand all Loading... |
260 // occurred on |view|, such as when the view is focused or when its | 265 // occurred on |view|, such as when the view is focused or when its |
261 // value changes. Pass true for |send_native_event| except for rare | 266 // value changes. Pass true for |send_native_event| except for rare |
262 // cases where the view is a native control that's already sending a | 267 // cases where the view is a native control that's already sending a |
263 // native accessibility event and the duplicate event would cause | 268 // native accessibility event and the duplicate event would cause |
264 // problems. | 269 // problems. |
265 virtual void NotifyAccessibilityEvent( | 270 virtual void NotifyAccessibilityEvent( |
266 View* view, | 271 View* view, |
267 ui::AccessibilityTypes::Event event_type, | 272 ui::AccessibilityTypes::Event event_type, |
268 bool send_native_event) = 0; | 273 bool send_native_event) = 0; |
269 | 274 |
270 NativeWidget* native_widget() { return native_widget_; } | 275 NativeWidget* native_widget() const { return native_widget_; } |
271 | 276 |
272 // Overridden from NativeWidgetDelegate: | 277 // Overridden from NativeWidgetDelegate: |
273 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE; | 278 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE; |
274 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE; | 279 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE; |
275 virtual void OnNativeWidgetCreated() OVERRIDE; | 280 virtual void OnNativeWidgetCreated() OVERRIDE; |
276 virtual void OnSizeChanged(const gfx::Size& new_size) OVERRIDE; | 281 virtual void OnSizeChanged(const gfx::Size& new_size) OVERRIDE; |
277 virtual bool HasFocusManager() const OVERRIDE; | 282 virtual bool HasFocusManager() const OVERRIDE; |
278 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; | 283 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; |
279 | 284 |
280 // Overridden from FocusTraversable: | 285 // Overridden from FocusTraversable: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 342 |
338 // The compositor for accelerated drawing. | 343 // The compositor for accelerated drawing. |
339 scoped_refptr<ui::Compositor> compositor_; | 344 scoped_refptr<ui::Compositor> compositor_; |
340 | 345 |
341 DISALLOW_COPY_AND_ASSIGN(Widget); | 346 DISALLOW_COPY_AND_ASSIGN(Widget); |
342 }; | 347 }; |
343 | 348 |
344 } // namespace views | 349 } // namespace views |
345 | 350 |
346 #endif // VIEWS_WIDGET_WIDGET_H_ | 351 #endif // VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |