OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_HOST_DESKTOP_H_ | 5 #ifndef CHROME_BROWSER_UI_HOST_DESKTOP_H_ |
6 #define CHROME_BROWSER_UI_HOST_DESKTOP_H_ | 6 #define CHROME_BROWSER_UI_HOST_DESKTOP_H_ |
7 | 7 |
| 8 #include "ui/gfx/native_widget_types.h" |
| 9 |
| 10 class Browser; |
| 11 |
8 namespace chrome { | 12 namespace chrome { |
9 | 13 |
10 // A value that specifies what desktop environment hosts a particular piece of | 14 // A value that specifies what desktop environment hosts a particular piece of |
11 // UI. | 15 // UI. |
12 // Note that HOST_DESKTOP_TYPE_ASH is always used on ChromeOS. | 16 // Note that HOST_DESKTOP_TYPE_ASH is always used on ChromeOS. |
13 enum HostDesktopType { | 17 enum HostDesktopType { |
| 18 HOST_DESKTOP_TYPE_FIRST = 0, |
| 19 |
14 // The UI is hosted on the system native desktop. | 20 // The UI is hosted on the system native desktop. |
15 HOST_DESKTOP_TYPE_NATIVE = 0, | 21 HOST_DESKTOP_TYPE_NATIVE = HOST_DESKTOP_TYPE_FIRST, |
16 | 22 |
17 // The UI is hosted in the synthetic Ash desktop. | 23 // The UI is hosted in the synthetic Ash desktop. |
18 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
19 HOST_DESKTOP_TYPE_ASH = HOST_DESKTOP_TYPE_NATIVE, | 25 HOST_DESKTOP_TYPE_ASH = HOST_DESKTOP_TYPE_NATIVE, |
20 #else | 26 #else |
21 HOST_DESKTOP_TYPE_ASH, | 27 HOST_DESKTOP_TYPE_ASH, |
22 #endif | 28 #endif |
23 | 29 |
24 HOST_DESKTOP_TYPE_COUNT | 30 HOST_DESKTOP_TYPE_COUNT |
25 }; | 31 }; |
26 | 32 |
| 33 class ScopedForceDesktopType { |
| 34 public: |
| 35 explicit ScopedForceDesktopType(HostDesktopType type); |
| 36 ~ScopedForceDesktopType(); |
| 37 private: |
| 38 DISALLOW_COPY_AND_ASSIGN(ScopedForceDesktopType); |
| 39 HostDesktopType previous_type_; |
| 40 bool previous_force_; |
| 41 }; |
| 42 |
| 43 HostDesktopType GetHostDesktopTypeForNativeView(gfx::NativeView native_view); |
| 44 HostDesktopType GetHostDesktopTypeForNativeWindow( |
| 45 gfx::NativeWindow native_window); |
| 46 HostDesktopType GetHostDesktopTypeForBrowser(const Browser* browser); |
| 47 |
27 /* | 48 /* |
28 TODO(beng): implement utilities as needed, e.g.: | 49 TODO(beng): implement utilities as needed, e.g.: |
29 HostDesktopType GetActiveDesktop(); | 50 HostDesktopType GetActiveDesktop(); |
30 HostDesktopType GetHostDesktopTypeForNativeView(gfx::NativeView native_view); | |
31 HostDesktopType GetHostDesktopTypeForNativeWindow( | |
32 gfx::NativeWindow native_window); | |
33 HostDesktopType GetHostDesktopTypeForBrowser(Browser* browser); | |
34 */ | 51 */ |
35 | 52 |
36 } // namespace chrome | 53 } // namespace chrome |
37 | 54 |
38 #endif // CHROME_BROWSER_UI_HOST_DESKTOP_H_ | 55 #endif // CHROME_BROWSER_UI_HOST_DESKTOP_H_ |
OLD | NEW |