| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 bool IsAccessibleWidget() const; | 205 bool IsAccessibleWidget() const; |
| 205 | 206 |
| 206 // Returns the ThemeProvider that provides theme resources for this Widget. | 207 // Returns the ThemeProvider that provides theme resources for this Widget. |
| 207 virtual ThemeProvider* GetThemeProvider() const; | 208 virtual ThemeProvider* GetThemeProvider() const; |
| 208 | 209 |
| 209 // Returns the FocusManager for this widget. | 210 // Returns the FocusManager for this widget. |
| 210 // Note that all widgets in a widget hierarchy share the same focus manager. | 211 // Note that all widgets in a widget hierarchy share the same focus manager. |
| 211 // TODO(beng): remove virtual. | 212 // TODO(beng): remove virtual. |
| 212 virtual FocusManager* GetFocusManager(); | 213 virtual FocusManager* GetFocusManager(); |
| 213 | 214 |
| 215 // Returns the InputMethod for this widget. |
| 216 // Note that all widgets in a widget hierarchy share the same input method. |
| 217 InputMethod* GetInputMethod() const; |
| 218 |
| 214 // Returns true if the native view |native_view| is contained in the | 219 // Returns true if the native view |native_view| is contained in the |
| 215 // views::View hierarchy rooted at this widget. | 220 // views::View hierarchy rooted at this widget. |
| 216 // TODO(beng): const. | 221 // TODO(beng): const. |
| 217 bool ContainsNativeView(gfx::NativeView native_view); | 222 bool ContainsNativeView(gfx::NativeView native_view); |
| 218 | 223 |
| 219 // Starts a drag operation for the specified view. This blocks until the drag | 224 // Starts a drag operation for the specified view. This blocks until the drag |
| 220 // operation completes. |view| can be NULL. | 225 // operation completes. |view| can be NULL. |
| 221 // If the view is non-NULL it can be accessed during the drag by calling | 226 // If the view is non-NULL it can be accessed during the drag by calling |
| 222 // dragged_view(). If the view has not been deleted during the drag, | 227 // dragged_view(). If the view has not been deleted during the drag, |
| 223 // OnDragDone() is called on it. | 228 // OnDragDone() is called on it. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 253 // occurred on |view|, such as when the view is focused or when its | 258 // occurred on |view|, such as when the view is focused or when its |
| 254 // value changes. Pass true for |send_native_event| except for rare | 259 // value changes. Pass true for |send_native_event| except for rare |
| 255 // cases where the view is a native control that's already sending a | 260 // cases where the view is a native control that's already sending a |
| 256 // native accessibility event and the duplicate event would cause | 261 // native accessibility event and the duplicate event would cause |
| 257 // problems. | 262 // problems. |
| 258 virtual void NotifyAccessibilityEvent( | 263 virtual void NotifyAccessibilityEvent( |
| 259 View* view, | 264 View* view, |
| 260 ui::AccessibilityTypes::Event event_type, | 265 ui::AccessibilityTypes::Event event_type, |
| 261 bool send_native_event) = 0; | 266 bool send_native_event) = 0; |
| 262 | 267 |
| 263 NativeWidget* native_widget() { return native_widget_; } | 268 NativeWidget* native_widget() const { return native_widget_; } |
| 264 | 269 |
| 265 // Overridden from NativeWidgetDelegate: | 270 // Overridden from NativeWidgetDelegate: |
| 266 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE; | 271 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE; |
| 267 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE; | 272 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE; |
| 268 virtual void OnNativeWidgetCreated() OVERRIDE; | 273 virtual void OnNativeWidgetCreated() OVERRIDE; |
| 269 virtual void OnSizeChanged(const gfx::Size& new_size) OVERRIDE; | 274 virtual void OnSizeChanged(const gfx::Size& new_size) OVERRIDE; |
| 270 virtual bool HasFocusManager() const OVERRIDE; | 275 virtual bool HasFocusManager() const OVERRIDE; |
| 271 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; | 276 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; |
| 272 | 277 |
| 273 // Overridden from FocusTraversable: | 278 // Overridden from FocusTraversable: |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 335 |
| 331 // The compositor for accelerated drawing. | 336 // The compositor for accelerated drawing. |
| 332 scoped_refptr<ui::Compositor> compositor_; | 337 scoped_refptr<ui::Compositor> compositor_; |
| 333 | 338 |
| 334 DISALLOW_COPY_AND_ASSIGN(Widget); | 339 DISALLOW_COPY_AND_ASSIGN(Widget); |
| 335 }; | 340 }; |
| 336 | 341 |
| 337 } // namespace views | 342 } // namespace views |
| 338 | 343 |
| 339 #endif // VIEWS_WIDGET_WIDGET_H_ | 344 #endif // VIEWS_WIDGET_WIDGET_H_ |
| OLD | NEW |