• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 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/native_browser_frame_factory.h"
6 
7 #include "chrome/browser/ui/views/frame/native_browser_frame.h"
8 
9 namespace {
10 
11 NativeBrowserFrameFactory* factory = NULL;
12 
13 }
14 
15 // static
CreateNativeBrowserFrame(BrowserFrame * browser_frame,BrowserView * browser_view)16 NativeBrowserFrame* NativeBrowserFrameFactory::CreateNativeBrowserFrame(
17     BrowserFrame* browser_frame,
18     BrowserView* browser_view) {
19   if (!factory)
20     factory = new NativeBrowserFrameFactory;
21   return factory->Create(browser_frame, browser_view);
22 }
23 
24 // static
Set(NativeBrowserFrameFactory * new_factory)25 void NativeBrowserFrameFactory::Set(NativeBrowserFrameFactory* new_factory) {
26   delete factory;
27   factory = new_factory;
28 }
29 
30 #if !defined(OS_WIN)
31 // static
AdjustHostDesktopType(chrome::HostDesktopType desktop_type)32 chrome::HostDesktopType NativeBrowserFrameFactory::AdjustHostDesktopType(
33     chrome::HostDesktopType desktop_type) {
34   return desktop_type;
35 }
36 #endif  // !defined(OS_WIN)
37 
38 #if !defined(USE_ASH) || defined(OS_CHROMEOS)
39 // static
ShouldCreateForAshDesktop(BrowserView * browser_view)40 bool NativeBrowserFrameFactory::ShouldCreateForAshDesktop(
41     BrowserView* browser_view) {
42   NOTREACHED();
43   return false;
44 }
45 #endif  // !defined(OS_WIN) || !defined(USE_ASH)
46