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 #include "ash/host/ash_window_tree_host.h" | 5 #include "ash/host/ash_window_tree_host.h" |
6 | 6 |
7 #include "ash/ash_export.h" | 7 #include "ash/ash_export.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/host/ash_remote_window_tree_host_win.h" | 9 #include "ash/host/ash_remote_window_tree_host_win.h" |
10 #include "ash/host/ash_window_tree_host_init_params.h" | 10 #include "ash/host/ash_window_tree_host_init_params.h" |
11 #include "ash/host/root_window_transformer.h" | 11 #include "ash/host/root_window_transformer.h" |
12 #include "ash/host/transformer_helper.h" | 12 #include "ash/host/transformer_helper.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/win/windows_version.h" | 14 #include "base/win/windows_version.h" |
15 #include "ui/aura/window_tree_host_win.h" | 15 #include "ui/aura/window_tree_host_win.h" |
16 #include "ui/gfx/geometry/insets.h" | 16 #include "ui/gfx/geometry/insets.h" |
17 #include "ui/gfx/transform.h" | 17 #include "ui/gfx/transform.h" |
18 | 18 |
19 namespace ash { | 19 namespace ash { |
20 namespace { | 20 namespace { |
21 | 21 |
22 class ASH_EXPORT AshWindowTreeHostWin : public AshWindowTreeHost, | 22 class ASH_EXPORT AshWindowTreeHostWin : public AshWindowTreeHost, |
23 public aura::WindowTreeHostWin { | 23 public aura::WindowTreeHostWin { |
24 public: | 24 public: |
25 explicit AshWindowTreeHostWin(const gfx::Rect& initial_bounds) | 25 AshWindowTreeHostWin(const gfx::Rect& initial_bounds, |
26 : aura::WindowTreeHostWin(initial_bounds), | 26 ui::ContextFactory* context_factory) |
| 27 : aura::WindowTreeHostWin(initial_bounds, context_factory), |
27 fullscreen_(false), | 28 fullscreen_(false), |
28 saved_window_style_(0), | 29 saved_window_style_(0), |
29 saved_window_ex_style_(0), | 30 saved_window_ex_style_(0), |
30 transformer_helper_(this) {} | 31 transformer_helper_(this) {} |
31 virtual ~AshWindowTreeHostWin() {} | 32 virtual ~AshWindowTreeHostWin() {} |
32 | 33 |
33 private: | 34 private: |
34 // AshWindowTreeHost: | 35 // AshWindowTreeHost: |
35 virtual void ToggleFullScreen() OVERRIDE { | 36 virtual void ToggleFullScreen() OVERRIDE { |
36 gfx::Rect target_rect; | 37 gfx::Rect target_rect; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostWin); | 110 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostWin); |
110 }; | 111 }; |
111 | 112 |
112 } // namespace | 113 } // namespace |
113 | 114 |
114 AshWindowTreeHost* AshWindowTreeHost::Create( | 115 AshWindowTreeHost* AshWindowTreeHost::Create( |
115 const AshWindowTreeHostInitParams& init_params) { | 116 const AshWindowTreeHostInitParams& init_params) { |
116 if (base::win::GetVersion() >= base::win::VERSION_WIN7 && | 117 if (base::win::GetVersion() >= base::win::VERSION_WIN7 && |
117 !CommandLine::ForCurrentProcess()->HasSwitch( | 118 !CommandLine::ForCurrentProcess()->HasSwitch( |
118 ash::switches::kForceAshToDesktop)) | 119 ash::switches::kForceAshToDesktop)) |
119 return new AshRemoteWindowTreeHostWin(init_params.remote_hwnd); | 120 return new AshRemoteWindowTreeHostWin(init_params.remote_hwnd, |
| 121 init_params.context_factory); |
120 | 122 |
121 return new AshWindowTreeHostWin(init_params.initial_bounds); | 123 return new AshWindowTreeHostWin(init_params.initial_bounds, |
| 124 init_params.context_factory); |
122 } | 125 } |
123 | 126 |
124 } // namespace ash | 127 } // namespace ash |
OLD | NEW |