| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_VIEWS_DELEGATE_H_ | 5 #ifndef UI_VIEWS_VIEWS_DELEGATE_H_ |
| 6 #define UI_VIEWS_VIEWS_DELEGATE_H_ | 6 #define UI_VIEWS_VIEWS_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "ui/base/accessibility/accessibility_types.h" | 15 #include "ui/base/accessibility/accessibility_types.h" |
| 16 #include "ui/base/ui_base_types.h" | 16 #include "ui/base/ui_base_types.h" |
| 17 #include "ui/gfx/native_widget_types.h" |
| 17 #include "ui/views/views_export.h" | 18 #include "ui/views/views_export.h" |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 class WebContents; | 21 class WebContents; |
| 21 class BrowserContext; | 22 class BrowserContext; |
| 22 class SiteInstance; | 23 class SiteInstance; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace gfx { | 26 namespace gfx { |
| 26 class Rect; | 27 class Rect; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace views { | 30 namespace views { |
| 30 | 31 |
| 32 class NativeWidget; |
| 31 class NonClientFrameView; | 33 class NonClientFrameView; |
| 32 class View; | 34 class View; |
| 33 class Widget; | 35 class Widget; |
| 34 | |
| 35 #if defined(USE_AURA) | 36 #if defined(USE_AURA) |
| 36 class NativeWidgetAura; | 37 class NativeWidgetAura; |
| 37 class NativeWidgetHelperAura; | 38 class NativeWidgetHelperAura; |
| 38 #endif | 39 #endif |
| 40 namespace internal { |
| 41 class NativeWidgetDelegate; |
| 42 } |
| 39 | 43 |
| 40 // ViewsDelegate is an interface implemented by an object using the views | 44 // ViewsDelegate is an interface implemented by an object using the views |
| 41 // framework. It is used to obtain various high level application utilities | 45 // framework. It is used to obtain various high level application utilities |
| 42 // and perform some actions such as window placement saving. | 46 // and perform some actions such as window placement saving. |
| 43 // | 47 // |
| 44 // The embedding app must set views_delegate to assign its ViewsDelegate | 48 // The embedding app must set views_delegate to assign its ViewsDelegate |
| 45 // implementation. | 49 // implementation. |
| 46 class VIEWS_EXPORT ViewsDelegate { | 50 class VIEWS_EXPORT ViewsDelegate { |
| 47 public: | 51 public: |
| 48 // The active ViewsDelegate used by the views system. | 52 // The active ViewsDelegate used by the views system. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // Creates an object that implements desktop integration behavior. Returned | 108 // Creates an object that implements desktop integration behavior. Returned |
| 105 // object is owned by the NativeWidgetAura passed in. May return NULL. | 109 // object is owned by the NativeWidgetAura passed in. May return NULL. |
| 106 virtual NativeWidgetHelperAura* CreateNativeWidgetHelper( | 110 virtual NativeWidgetHelperAura* CreateNativeWidgetHelper( |
| 107 NativeWidgetAura* native_widget) = 0; | 111 NativeWidgetAura* native_widget) = 0; |
| 108 #endif | 112 #endif |
| 109 | 113 |
| 110 // Creates a web contents. This will return NULL unless overriden. | 114 // Creates a web contents. This will return NULL unless overriden. |
| 111 virtual content::WebContents* CreateWebContents( | 115 virtual content::WebContents* CreateWebContents( |
| 112 content::BrowserContext* browser_context, | 116 content::BrowserContext* browser_context, |
| 113 content::SiteInstance* site_instance) = 0; | 117 content::SiteInstance* site_instance) = 0; |
| 118 |
| 119 // Creates a NativeWidget implementation. Returning NULL means Widget will |
| 120 // create a default implementation for the platform. |
| 121 virtual NativeWidget* CreateNativeWidget( |
| 122 internal::NativeWidgetDelegate* delegate, |
| 123 gfx::NativeView parent) = 0; |
| 114 }; | 124 }; |
| 115 | 125 |
| 116 } // namespace views | 126 } // namespace views |
| 117 | 127 |
| 118 #endif // UI_VIEWS_VIEWS_DELEGATE_H_ | 128 #endif // UI_VIEWS_VIEWS_DELEGATE_H_ |
| OLD | NEW |