1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/apps/chrome_app_window_client.h"
7 #include "base/command_line.h"
8 #import "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h"
9 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.h"
10 #include "chrome/common/chrome_switches.h"
14 bool UseMacViewsNativeAppWindows() {
15 const base::CommandLine* command_line =
16 base::CommandLine::ForCurrentProcess();
17 if (command_line->HasSwitch(switches::kEnableMacViewsNativeAppWindows))
19 if (command_line->HasSwitch(switches::kDisableMacViewsNativeAppWindows))
21 return false; // Current default.
27 extensions::NativeAppWindow* ChromeAppWindowClient::CreateNativeAppWindowImpl(
28 extensions::AppWindow* app_window,
29 const extensions::AppWindow::CreateParams& params) {
30 if (UseMacViewsNativeAppWindows()) {
31 ChromeNativeAppWindowViewsMac* window = new ChromeNativeAppWindowViewsMac;
32 window->Init(app_window, params);
36 return new NativeAppWindowCocoa(app_window, params);