OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h" | 5 #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/frame/native_browser_frame.h" | 7 #include "chrome/browser/ui/views/frame/native_browser_frame.h" |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
11 NativeBrowserFrameFactory* factory = NULL; | 11 NativeBrowserFrameFactory* factory = NULL; |
12 | 12 |
13 } | 13 } |
14 | 14 |
15 // static | 15 // static |
16 NativeBrowserFrame* NativeBrowserFrameFactory::CreateNativeBrowserFrame( | 16 NativeBrowserFrame* NativeBrowserFrameFactory::CreateNativeBrowserFrame( |
17 BrowserFrame* browser_frame, | 17 BrowserFrame* browser_frame, |
18 BrowserView* browser_view) { | 18 BrowserView* browser_view) { |
19 if (!factory) | 19 if (!factory) |
20 factory = new NativeBrowserFrameFactory; | 20 factory = new NativeBrowserFrameFactory; |
21 return factory->Create(browser_frame, browser_view); | 21 return factory->Create(browser_frame, browser_view); |
22 } | 22 } |
23 | 23 |
24 // static | 24 // static |
25 void NativeBrowserFrameFactory::Set(NativeBrowserFrameFactory* new_factory) { | 25 void NativeBrowserFrameFactory::Set(NativeBrowserFrameFactory* new_factory) { |
26 delete factory; | 26 delete factory; |
27 factory = new_factory; | 27 factory = new_factory; |
28 } | 28 } |
| 29 |
| 30 #if !defined(OS_WIN) |
| 31 // static |
| 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 |
| 40 bool NativeBrowserFrameFactory::ShouldCreateForAshDesktop( |
| 41 BrowserView* browser_view) { |
| 42 NOTREACHED(); |
| 43 return false; |
| 44 } |
| 45 #endif // !defined(OS_WIN) || !defined(USE_ASH) |
OLD | NEW |