Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: ui/views_content_client/views_content_client_main_parts_desktop_aura.cc

Issue 297143009: MacViews: Gets views_examples_with_content_exe compiling on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to master Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views_content_client/views_content_client_main_parts_desktop_aura.cc
diff --git a/ui/views_content_client/views_content_client_main_parts_desktop_aura.cc b/ui/views_content_client/views_content_client_main_parts_desktop_aura.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ec8b75bed2e96f6b2e3165153be9017e612e7f79
--- /dev/null
+++ b/ui/views_content_client/views_content_client_main_parts_desktop_aura.cc
@@ -0,0 +1,57 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/shell/browser/shell_browser_context.h"
+#include "ui/aura/env.h"
+#include "ui/gfx/screen.h"
+#include "ui/views/widget/desktop_aura/desktop_screen.h"
+#include "ui/views_content_client/views_content_client.h"
+#include "ui/views_content_client/views_content_client_main_parts_aura.h"
+
+namespace ui {
+
+namespace {
+
+class ViewsContentClientMainPartsDesktopAura
+ : public ViewsContentClientMainPartsAura {
+ public:
+ ViewsContentClientMainPartsDesktopAura(
+ const content::MainFunctionParams& content_params,
+ ViewsContentClient* views_content_client);
+ virtual ~ViewsContentClientMainPartsDesktopAura() {}
+
+ // content::BrowserMainParts:
+ virtual void PreMainMessageLoopRun() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsDesktopAura);
+};
+
+ViewsContentClientMainPartsDesktopAura::ViewsContentClientMainPartsDesktopAura(
+ const content::MainFunctionParams& content_params,
+ ViewsContentClient* views_content_client)
+ : ViewsContentClientMainPartsAura(content_params, views_content_client) {
+}
+
+void ViewsContentClientMainPartsDesktopAura::PreMainMessageLoopRun() {
+ ViewsContentClientMainPartsAura::PreMainMessageLoopRun();
+
+ aura::Env::CreateInstance(true);
+ gfx::Screen::SetScreenInstance(
+ gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen());
+
+ views_content_client()->task().Run(browser_context(), NULL);
+}
+
+} // namespace
+
+// static
+ViewsContentClientMainParts* ViewsContentClientMainParts::Create(
+ const content::MainFunctionParams& content_params,
+ ViewsContentClient* views_content_client) {
+ return new ViewsContentClientMainPartsDesktopAura(
+ content_params, views_content_client);
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698