OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ | 5 #ifndef APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ |
6 #define APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ | 6 #define APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "ui/aura/window_tree_host_observer.h" | 11 #include "ui/aura/window_tree_host_observer.h" |
12 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
13 | 13 |
14 #if defined(OS_CHROMEOS) && defined(USE_X11) | 14 #if defined(OS_CHROMEOS) |
15 #include "ui/display/chromeos/output_configurator.h" | 15 #include "ui/display/chromeos/output_configurator.h" |
16 #endif | 16 #endif |
17 | 17 |
18 namespace aura { | 18 namespace aura { |
19 class TestScreen; | 19 class TestScreen; |
20 class WindowTreeHost; | 20 class WindowTreeHost; |
21 } | 21 } |
22 | 22 |
23 namespace wm { | 23 namespace wm { |
24 class WMTestHelper; | 24 class WMTestHelper; |
25 } | 25 } |
26 | 26 |
27 namespace apps { | 27 namespace apps { |
28 | 28 |
29 // Handles desktop-related tasks for app_shell. | 29 // Handles desktop-related tasks for app_shell. |
30 class ShellDesktopController | 30 class ShellDesktopController |
31 #if defined(OS_CHROMEOS) && defined(USE_X11) | 31 #if defined(OS_CHROMEOS) |
32 : public ui::OutputConfigurator::Observer | 32 : public ui::OutputConfigurator::Observer |
33 #endif | 33 #endif |
34 { | 34 { |
35 public: | 35 public: |
36 ShellDesktopController(); | 36 ShellDesktopController(); |
37 virtual ~ShellDesktopController(); | 37 virtual ~ShellDesktopController(); |
38 | 38 |
39 // Returns the host for the Aura window tree. | 39 // Returns the host for the Aura window tree. |
40 aura::WindowTreeHost* GetWindowTreeHost(); | 40 aura::WindowTreeHost* GetWindowTreeHost(); |
41 | 41 |
42 #if defined(OS_CHROMEOS) && defined(USE_X11) | 42 #if defined(OS_CHROMEOS) |
43 // ui::OutputConfigurator::Observer overrides. | 43 // ui::OutputConfigurator::Observer overrides. |
44 virtual void OnDisplayModeChanged( | 44 virtual void OnDisplayModeChanged( |
45 const std::vector<ui::OutputConfigurator::DisplayState>& outputs) | 45 const std::vector<ui::OutputConfigurator::DisplayState>& outputs) |
46 OVERRIDE; | 46 OVERRIDE; |
47 #endif | 47 #endif |
48 | 48 |
49 private: | 49 private: |
50 // Creates the window that hosts the app. | 50 // Creates the window that hosts the app. |
51 void CreateRootWindow(); | 51 void CreateRootWindow(); |
52 | 52 |
53 // Closes and destroys the root window hosting the app. | 53 // Closes and destroys the root window hosting the app. |
54 void DestroyRootWindow(); | 54 void DestroyRootWindow(); |
55 | 55 |
56 // Returns the dimensions (in pixels) of the primary display, or an empty size | 56 // Returns the dimensions (in pixels) of the primary display, or an empty size |
57 // if the dimensions can't be determined or no display is connected. | 57 // if the dimensions can't be determined or no display is connected. |
58 gfx::Size GetPrimaryDisplaySize(); | 58 gfx::Size GetPrimaryDisplaySize(); |
59 | 59 |
60 #if defined(OS_CHROMEOS) && defined(USE_X11) | 60 #if defined(OS_CHROMEOS) |
61 scoped_ptr<ui::OutputConfigurator> output_configurator_; | 61 scoped_ptr<ui::OutputConfigurator> output_configurator_; |
62 #endif | 62 #endif |
63 | 63 |
64 // Enable a minimal set of views::corewm to be initialized. | 64 // Enable a minimal set of views::corewm to be initialized. |
65 scoped_ptr<wm::WMTestHelper> wm_test_helper_; | 65 scoped_ptr<wm::WMTestHelper> wm_test_helper_; |
66 | 66 |
67 scoped_ptr<aura::TestScreen> test_screen_; | 67 scoped_ptr<aura::TestScreen> test_screen_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(ShellDesktopController); | 69 DISALLOW_COPY_AND_ASSIGN(ShellDesktopController); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace apps | 72 } // namespace apps |
73 | 73 |
74 #endif // APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ | 74 #endif // APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ |
OLD | NEW |