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

Unified Diff: chrome/browser/ui/cocoa/apps/chrome_app_window_client_views_cocoa.mm

Issue 1167883002: [Mac] Include MacViews native app windows in regular builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@drag_event
Patch Set: Address comments. Created 5 years, 6 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
« no previous file with comments | « chrome/browser/ui/cocoa/apps/chrome_app_window_client_cocoa.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/apps/chrome_app_window_client_views_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/apps/chrome_app_window_client_views_cocoa.mm b/chrome/browser/ui/cocoa/apps/chrome_app_window_client_views_cocoa.mm
new file mode 100644
index 0000000000000000000000000000000000000000..5185df5d294c832f1cfa19c956eac0e03cd83a08
--- /dev/null
+++ b/chrome/browser/ui/cocoa/apps/chrome_app_window_client_views_cocoa.mm
@@ -0,0 +1,37 @@
+// 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 "chrome/browser/ui/apps/chrome_app_window_client.h"
+
+#include "base/command_line.h"
+#import "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h"
+#include "chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.h"
+#include "chrome/common/chrome_switches.h"
+
+namespace {
+
+bool UseMacViewsNativeAppWindows() {
+ const base::CommandLine* command_line =
+ base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kEnableMacViewsNativeAppWindows))
+ return true;
+ if (command_line->HasSwitch(switches::kDisableMacViewsNativeAppWindows))
+ return false;
+ return false; // Current default.
+}
+
+} // namespace
+
+// static
+extensions::NativeAppWindow* ChromeAppWindowClient::CreateNativeAppWindowImpl(
+ extensions::AppWindow* app_window,
+ const extensions::AppWindow::CreateParams& params) {
+ if (UseMacViewsNativeAppWindows()) {
+ ChromeNativeAppWindowViewsMac* window = new ChromeNativeAppWindowViewsMac;
+ window->Init(app_window, params);
+ return window;
+ }
+
+ return new NativeAppWindowCocoa(app_window, params);
+}
« no previous file with comments | « chrome/browser/ui/cocoa/apps/chrome_app_window_client_cocoa.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698