Index: ui/views_content_client/views_content_client_main_parts_mac.mm |
diff --git a/ui/views_content_client/views_content_client_main_parts_mac.mm b/ui/views_content_client/views_content_client_main_parts_mac.mm |
index afeae12bc963e8d060bc7c2ef501f461c45767ca..a1f2d2440548063d0cd8dfbb6f1b6594c1d798c7 100644 |
--- a/ui/views_content_client/views_content_client_main_parts_mac.mm |
+++ b/ui/views_content_client/views_content_client_main_parts_mac.mm |
@@ -7,9 +7,11 @@ |
#include "base/files/file_path.h" |
#include "base/mac/scoped_nsobject.h" |
#include "base/path_service.h" |
+#include "content/public/browser/context_factory.h" |
#include "content/public/browser/plugin_service.h" |
#include "content/public/common/content_paths.h" |
#include "content/shell/browser/shell_browser_context.h" |
+#include "ui/views/test/desktop_test_views_delegate.h" |
#include "ui/views_content_client/views_content_client.h" |
#include "ui/views_content_client/views_content_client_main_parts.h" |
@@ -41,10 +43,18 @@ class ViewsContentClientMainPartsMac : public ViewsContentClientMainParts { |
private: |
base::scoped_nsobject<ViewsContentClientAppController> app_controller_; |
+ scoped_ptr<views::ViewsDelegate> composited_views_delegate_; |
DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsMac); |
}; |
+class CompositedTestViewsDelegate : public views::DesktopTestViewsDelegate { |
+ public: |
+ virtual ui::ContextFactory* GetContextFactory() OVERRIDE { |
+ return content::GetContextFactory(); |
+ } |
+}; |
+ |
ViewsContentClientMainPartsMac::ViewsContentClientMainPartsMac( |
const content::MainFunctionParams& content_params, |
ViewsContentClient* views_content_client) |
@@ -64,6 +74,14 @@ ViewsContentClientMainPartsMac::ViewsContentClientMainPartsMac( |
void ViewsContentClientMainPartsMac::PreMainMessageLoopRun() { |
ViewsContentClientMainParts::PreMainMessageLoopRun(); |
+ views_delegate_.reset(); // FIXME |
+ |
+ // If run with --enable-delegated-renderer, the GPU channel factory and image |
+ // transport factory for communicating with the GPU process should already be |
+ // initialized. This is the default on Mac as of r281692. Otherwise, this file |
+ // needs a content/browser dependency and some initialization steps here. |
+ composited_views_delegate_.reset(new CompositedTestViewsDelegate); |
+ |
// On Mac, the task must be deferred to applicationDidFinishLaunching. If not, |
// the widget can activate, but (even if configured) the mainMenu won't be |
// ready to switch over in the OSX UI, so it will look strange. |