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 "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "chrome/browser/mojo_runner_util.h" |
8 #include "chrome/browser/ui/views/frame/browser_frame_ashwin.h" | 9 #include "chrome/browser/ui/views/frame/browser_frame_ashwin.h" |
9 #include "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h" | 10 #include "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h" |
10 | 11 |
| 12 #if defined(MOJO_RUNNER_CLIENT) |
| 13 #include "chrome/browser/ui/views/frame/browser_frame_mus.h" |
| 14 #endif |
| 15 |
11 NativeBrowserFrame* NativeBrowserFrameFactory::Create( | 16 NativeBrowserFrame* NativeBrowserFrameFactory::Create( |
12 BrowserFrame* browser_frame, | 17 BrowserFrame* browser_frame, |
13 BrowserView* browser_view) { | 18 BrowserView* browser_view) { |
| 19 #if defined(MOJO_RUNNER_CLIENT) |
| 20 if (IsRunningInMojoRunner()) |
| 21 return new BrowserFrameMus(browser_frame, browser_view); |
| 22 #endif |
| 23 |
14 if (ShouldCreateForAshDesktop(browser_view)) | 24 if (ShouldCreateForAshDesktop(browser_view)) |
15 return new BrowserFrameAshWin(browser_frame, browser_view); | 25 return new BrowserFrameAshWin(browser_frame, browser_view); |
16 | 26 |
17 return new DesktopBrowserFrameAura(browser_frame, browser_view); | 27 return new DesktopBrowserFrameAura(browser_frame, browser_view); |
18 } | 28 } |
19 | 29 |
20 // static | 30 // static |
21 chrome::HostDesktopType NativeBrowserFrameFactory::AdjustHostDesktopType( | 31 chrome::HostDesktopType NativeBrowserFrameFactory::AdjustHostDesktopType( |
22 chrome::HostDesktopType desktop_type) { | 32 chrome::HostDesktopType desktop_type) { |
23 if (ash::Shell::HasInstance()) | 33 if (ash::Shell::HasInstance()) |
24 return chrome::HOST_DESKTOP_TYPE_ASH; | 34 return chrome::HOST_DESKTOP_TYPE_ASH; |
25 | 35 |
26 return desktop_type; | 36 return desktop_type; |
27 } | 37 } |
OLD | NEW |