1 // Copyright (c) 2012 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. 4 5 #include "chrome/browser/ui/views/frame/browser_view.h" 6 7 #include "base/command_line.h" 8 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" 9 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" 10 11 #if defined(OS_WIN) 12 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" 13 #endif 14 15 namespace chrome { 16 17 BrowserNonClientFrameView* CreateBrowserNonClientFrameView( 18 BrowserFrame* frame, BrowserView* browser_view) { 19 #if !defined(OS_CHROMEOS) 20 if (browser_view->browser()-> 21 host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) { 22 #if defined(OS_WIN) 23 if (frame->ShouldUseNativeFrame()) 24 return new GlassBrowserFrameView(frame, browser_view); 25 #endif 26 return new OpaqueBrowserFrameView(frame, browser_view); 27 } 28 #endif 29 30 BrowserNonClientFrameViewAsh* frame_view = 31 new BrowserNonClientFrameViewAsh(frame, browser_view); 32 frame_view->Init(); 33 return frame_view; 34 } 35 36 } // namespace chrome 37