| 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/views/views_export.h" | 17 #include "ui/views/views_export.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class WebContents; | 20 class WebContents; |
| 21 class BrowserContext; | 21 class BrowserContext; |
| 22 class SiteInstance; | 22 class SiteInstance; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace gfx { | 25 namespace gfx { |
| 26 class Rect; | 26 class Rect; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace ui { | |
| 30 class Clipboard; | |
| 31 } | |
| 32 | |
| 33 namespace views { | 29 namespace views { |
| 34 | 30 |
| 35 class NonClientFrameView; | 31 class NonClientFrameView; |
| 36 class View; | 32 class View; |
| 37 class Widget; | 33 class Widget; |
| 38 | 34 |
| 39 #if defined(USE_AURA) | 35 #if defined(USE_AURA) |
| 40 class NativeWidgetAura; | 36 class NativeWidgetAura; |
| 41 class NativeWidgetHelperAura; | 37 class NativeWidgetHelperAura; |
| 42 #endif | 38 #endif |
| 43 | 39 |
| 44 // ViewsDelegate is an interface implemented by an object using the views | 40 // ViewsDelegate is an interface implemented by an object using the views |
| 45 // framework. It is used to obtain various high level application utilities | 41 // framework. It is used to obtain various high level application utilities |
| 46 // and perform some actions such as window placement saving. | 42 // and perform some actions such as window placement saving. |
| 47 // | 43 // |
| 48 // The embedding app must set views_delegate to assign its ViewsDelegate | 44 // The embedding app must set views_delegate to assign its ViewsDelegate |
| 49 // implementation. | 45 // implementation. |
| 50 class VIEWS_EXPORT ViewsDelegate { | 46 class VIEWS_EXPORT ViewsDelegate { |
| 51 public: | 47 public: |
| 52 // The active ViewsDelegate used by the views system. | 48 // The active ViewsDelegate used by the views system. |
| 53 static ViewsDelegate* views_delegate; | 49 static ViewsDelegate* views_delegate; |
| 54 | 50 |
| 55 virtual ~ViewsDelegate() {} | 51 virtual ~ViewsDelegate() {} |
| 56 | 52 |
| 57 // Gets the clipboard. | |
| 58 virtual ui::Clipboard* GetClipboard() const = 0; | |
| 59 | |
| 60 // Saves the position, size and "show" state for the window with the | 53 // Saves the position, size and "show" state for the window with the |
| 61 // specified name. | 54 // specified name. |
| 62 virtual void SaveWindowPlacement(const Widget* widget, | 55 virtual void SaveWindowPlacement(const Widget* widget, |
| 63 const std::string& window_name, | 56 const std::string& window_name, |
| 64 const gfx::Rect& bounds, | 57 const gfx::Rect& bounds, |
| 65 ui::WindowShowState show_state) = 0; | 58 ui::WindowShowState show_state) = 0; |
| 66 | 59 |
| 67 // Retrieves the saved position and size and "show" state for the window with | 60 // Retrieves the saved position and size and "show" state for the window with |
| 68 // the specified name. | 61 // the specified name. |
| 69 virtual bool GetSavedWindowPlacement( | 62 virtual bool GetSavedWindowPlacement( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 109 |
| 117 // Creates a web contents. This will return NULL unless overriden. | 110 // Creates a web contents. This will return NULL unless overriden. |
| 118 virtual content::WebContents* CreateWebContents( | 111 virtual content::WebContents* CreateWebContents( |
| 119 content::BrowserContext* browser_context, | 112 content::BrowserContext* browser_context, |
| 120 content::SiteInstance* site_instance) = 0; | 113 content::SiteInstance* site_instance) = 0; |
| 121 }; | 114 }; |
| 122 | 115 |
| 123 } // namespace views | 116 } // namespace views |
| 124 | 117 |
| 125 #endif // UI_VIEWS_VIEWS_DELEGATE_H_ | 118 #endif // UI_VIEWS_VIEWS_DELEGATE_H_ |
| OLD | NEW |