| 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_NATIVE_WIDGET_DELEGATE_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
| 6 #define VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 6 #define VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 namespace gfx { | 9 namespace gfx { |
| 10 class Canvas; | 10 class Canvas; |
| 11 class Size; | 11 class Size; |
| 12 } | 12 } |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 //////////////////////////////////////////////////////////////////////////////// | 17 //////////////////////////////////////////////////////////////////////////////// |
| 18 // NativeWidgetDelegate | 18 // NativeWidgetDelegate |
| 19 // | 19 // |
| 20 // An interface implemented by the object that handles events sent by a | 20 // An interface implemented by the object that handles events sent by a |
| 21 // NativeWidget implementation. | 21 // NativeWidget implementation. |
| 22 // | 22 // |
| 23 class NativeWidgetDelegate { | 23 class NativeWidgetDelegate { |
| 24 public: | 24 public: |
| 25 virtual ~NativeWidgetDelegate() {} | 25 virtual ~NativeWidgetDelegate() {} |
| 26 | 26 |
| 27 // Returns true if the window is modal. |
| 28 virtual bool IsModal() const = 0; |
| 29 |
| 30 // Returns true if the window is a dialog box. |
| 31 virtual bool IsDialogBox() const = 0; |
| 32 |
| 27 // Returns true if the window can be activated. | 33 // Returns true if the window can be activated. |
| 28 virtual bool CanActivate() const = 0; | 34 virtual bool CanActivate() const = 0; |
| 29 | 35 |
| 30 virtual bool IsInactiveRenderingDisabled() const = 0; | 36 virtual bool IsInactiveRenderingDisabled() const = 0; |
| 31 virtual void EnableInactiveRendering() = 0; | 37 virtual void EnableInactiveRendering() = 0; |
| 32 | 38 |
| 33 // Called when the activation state of a window has changed. | 39 // Called when the activation state of a window has changed. |
| 34 virtual void OnNativeWidgetActivationChanged(bool active) = 0; | 40 virtual void OnNativeWidgetActivationChanged(bool active) = 0; |
| 35 | 41 |
| 36 // Called when native focus moves from one native view to another. | 42 // Called when native focus moves from one native view to another. |
| 37 virtual void OnNativeFocus(gfx::NativeView focused_view) = 0; | 43 virtual void OnNativeFocus(gfx::NativeView focused_view) = 0; |
| 38 virtual void OnNativeBlur(gfx::NativeView focused_view) = 0; | 44 virtual void OnNativeBlur(gfx::NativeView focused_view) = 0; |
| 39 | 45 |
| 40 // Called when the native widget is created. | 46 // Called when the native widget is created. |
| 41 virtual void OnNativeWidgetCreated() = 0; | 47 virtual void OnNativeWidgetCreated(const gfx::Rect& create_bounds) = 0; |
| 42 | 48 |
| 43 // Called just before the native widget is destroyed. This is the delegate's | 49 // Called just before the native widget is destroyed. This is the delegate's |
| 44 // last chance to do anything with the native widget handle. | 50 // last chance to do anything with the native widget handle. |
| 45 virtual void OnNativeWidgetDestroying() = 0; | 51 virtual void OnNativeWidgetDestroying() = 0; |
| 46 | 52 |
| 47 // Called just after the native widget is destroyed. | 53 // Called just after the native widget is destroyed. |
| 48 virtual void OnNativeWidgetDestroyed() = 0; | 54 virtual void OnNativeWidgetDestroyed() = 0; |
| 49 | 55 |
| 50 // Returns the smallest size the window can be resized to by the user. | 56 // Returns the smallest size the window can be resized to by the user. |
| 51 virtual gfx::Size GetMinimumSize() = 0; | 57 virtual gfx::Size GetMinimumSize() = 0; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 89 |
| 84 // | 90 // |
| 85 virtual Widget* AsWidget() = 0; | 91 virtual Widget* AsWidget() = 0; |
| 86 virtual const Widget* AsWidget() const = 0; | 92 virtual const Widget* AsWidget() const = 0; |
| 87 }; | 93 }; |
| 88 | 94 |
| 89 } // namespace internal | 95 } // namespace internal |
| 90 } // namespace views | 96 } // namespace views |
| 91 | 97 |
| 92 #endif // VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 98 #endif // VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
| OLD | NEW |