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 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_FACTORY_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_FACTORY_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_FACTORY_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/ui/host_desktop.h" | 9 #include "chrome/browser/ui/host_desktop.h" |
10 | 10 |
11 class BrowserFrame; | 11 class BrowserFrame; |
12 class BrowserView; | 12 class BrowserView; |
13 class NativeBrowserFrame; | 13 class NativeBrowserFrame; |
14 | 14 |
15 // Factory for creating a NativeBrowserFrame. | 15 // Factory for creating a NativeBrowserFrame. |
16 class NativeBrowserFrameFactory { | 16 class NativeBrowserFrameFactory { |
17 public: | 17 public: |
18 // Construct a platform-specific implementation of this interface. | 18 // Construct a platform-specific implementation of this interface. |
19 static NativeBrowserFrame* CreateNativeBrowserFrame( | 19 static NativeBrowserFrame* CreateNativeBrowserFrame( |
20 BrowserFrame* browser_frame, | 20 BrowserFrame* browser_frame, |
21 BrowserView* browser_view); | 21 BrowserView* browser_view); |
22 | 22 |
23 // Sets the factory. Takes ownership of |new_factory|, deleting existing | 23 // Sets the factory. Takes ownership of |new_factory|, deleting existing |
24 // factory. Use null to go back to default factory. | 24 // factory. Use null to go back to default factory. |
25 static void Set(NativeBrowserFrameFactory* new_factory); | 25 static void Set(NativeBrowserFrameFactory* new_factory); |
26 | 26 |
27 // Returns HOST_DESKTOP_TYPE_ASH on Windows when configured to allow browser | |
28 // windows only in Metro mode, otherwise |desktop_type|. | |
29 static chrome::HostDesktopType AdjustHostDesktopType( | |
30 chrome::HostDesktopType desktop_type); | |
31 | |
32 virtual NativeBrowserFrame* Create(BrowserFrame* browser_frame, | 27 virtual NativeBrowserFrame* Create(BrowserFrame* browser_frame, |
33 BrowserView* browser_view); | 28 BrowserView* browser_view); |
34 | 29 |
35 protected: | 30 protected: |
36 NativeBrowserFrameFactory() {} | 31 NativeBrowserFrameFactory() {} |
37 virtual ~NativeBrowserFrameFactory() {} | 32 virtual ~NativeBrowserFrameFactory() {} |
38 | 33 |
39 private: | 34 private: |
40 // For Chrome running on desktop platforms, returns true if the factory should | |
41 // create an ash browser frame for the provided |browser_view|. | |
42 static bool ShouldCreateForAshDesktop(BrowserView* browser_view); | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(NativeBrowserFrameFactory); | 35 DISALLOW_COPY_AND_ASSIGN(NativeBrowserFrameFactory); |
45 }; | 36 }; |
46 | 37 |
47 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_FACTORY_H_ | 38 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_FACTORY_H_ |
OLD | NEW |