Index: ui/views/views_delegate.h |
diff --git a/ui/views/views_delegate.h b/ui/views/views_delegate.h |
index 39c7f5a54ea7186b1172a2f84bb16a6c72dd5bd3..e2f33b05caa5e032b7575788c8e6b364d7b61e6d 100644 |
--- a/ui/views/views_delegate.h |
+++ b/ui/views/views_delegate.h |
@@ -60,8 +60,8 @@ class NativeWidgetDelegate; |
// framework. It is used to obtain various high level application utilities |
// and perform some actions such as window placement saving. |
// |
-// The embedding app must set views_delegate to assign its ViewsDelegate |
-// implementation. |
+// The embedding app must set the ViewsDelegate instance by instantiating an |
+// implementation of ViewsDelegate (the constructor will set the instance). |
class VIEWS_EXPORT ViewsDelegate { |
public: |
#if defined(OS_WIN) |
@@ -73,9 +73,11 @@ class VIEWS_EXPORT ViewsDelegate { |
}; |
#endif |
- ViewsDelegate(); |
virtual ~ViewsDelegate(); |
+ // Returns the ViewsDelegate instance if there is one, or nullptr otherwise. |
+ static ViewsDelegate* GetInstance(); |
+ |
// Saves the position, size and "show" state for the window with the |
// specified name. |
virtual void SaveWindowPlacement(const Widget* widget, |
@@ -160,8 +162,8 @@ class VIEWS_EXPORT ViewsDelegate { |
// Returns a blocking pool task runner given a TaskRunnerType. |
virtual scoped_refptr<base::TaskRunner> GetBlockingPoolTaskRunner(); |
- // The active ViewsDelegate used by the views system. |
- static ViewsDelegate* views_delegate; |
+ protected: |
+ ViewsDelegate(); |
private: |
scoped_ptr<ViewsTouchEditingControllerFactory> views_tsc_factory_; |