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" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 SetWindowPos(hwnd(), | 61 SetWindowPos(hwnd(), |
62 NULL, | 62 NULL, |
63 target_rect.x(), | 63 target_rect.x(), |
64 target_rect.y(), | 64 target_rect.y(), |
65 target_rect.width(), | 65 target_rect.width(), |
66 target_rect.height(), | 66 target_rect.height(), |
67 SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); | 67 SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); |
68 } | 68 } |
69 bool ConfineCursorToRootWindow() override { return false; } | 69 bool ConfineCursorToRootWindow() override { return false; } |
70 void UnConfineCursor() override { NOTIMPLEMENTED(); } | 70 void UnConfineCursor() override { NOTIMPLEMENTED(); } |
71 void SetRootWindowTransformer(scoped_ptr<RootWindowTransformer> transformer) { | 71 void SetRootWindowTransformer( |
| 72 scoped_ptr<RootWindowTransformer> transformer) override { |
72 transformer_helper_.SetRootWindowTransformer(transformer.Pass()); | 73 transformer_helper_.SetRootWindowTransformer(transformer.Pass()); |
73 } | 74 } |
74 gfx::Insets GetHostInsets() const override { | 75 gfx::Insets GetHostInsets() const override { |
75 return transformer_helper_.GetHostInsets(); | 76 return transformer_helper_.GetHostInsets(); |
76 } | 77 } |
77 aura::WindowTreeHost* AsWindowTreeHost() override { return this; } | 78 aura::WindowTreeHost* AsWindowTreeHost() override { return this; } |
78 | 79 |
79 // WindowTreeHostWin: | 80 // WindowTreeHostWin: |
80 void SetBounds(const gfx::Rect& bounds) override { | 81 void SetBounds(const gfx::Rect& bounds) override { |
81 if (fullscreen_) { | 82 if (fullscreen_) { |
82 saved_window_rect_.right = saved_window_rect_.left + bounds.width(); | 83 saved_window_rect_.right = saved_window_rect_.left + bounds.width(); |
83 saved_window_rect_.bottom = saved_window_rect_.top + bounds.height(); | 84 saved_window_rect_.bottom = saved_window_rect_.top + bounds.height(); |
84 return; | 85 return; |
85 } | 86 } |
86 WindowTreeHostWin::SetBounds(bounds); | 87 WindowTreeHostWin::SetBounds(bounds); |
87 } | 88 } |
88 void SetRootTransform(const gfx::Transform& transform) override { | 89 void SetRootTransform(const gfx::Transform& transform) override { |
89 transformer_helper_.SetTransform(transform); | 90 transformer_helper_.SetTransform(transform); |
90 } | 91 } |
91 gfx::Transform GetRootTransform() const { | 92 gfx::Transform GetRootTransform() const override { |
92 return transformer_helper_.GetTransform(); | 93 return transformer_helper_.GetTransform(); |
93 } | 94 } |
94 gfx::Transform GetInverseRootTransform() const override { | 95 gfx::Transform GetInverseRootTransform() const override { |
95 return transformer_helper_.GetInverseTransform(); | 96 return transformer_helper_.GetInverseTransform(); |
96 } | 97 } |
97 void UpdateRootWindowSize(const gfx::Size& host_size) override { | 98 void UpdateRootWindowSize(const gfx::Size& host_size) override { |
98 transformer_helper_.UpdateWindowSize(host_size); | 99 transformer_helper_.UpdateWindowSize(host_size); |
99 } | 100 } |
100 | 101 |
101 bool fullscreen_; | 102 bool fullscreen_; |
(...skipping 12 matching lines...) Expand all Loading... |
114 const AshWindowTreeHostInitParams& init_params) { | 115 const AshWindowTreeHostInitParams& init_params) { |
115 if (base::win::GetVersion() >= base::win::VERSION_WIN7 && | 116 if (base::win::GetVersion() >= base::win::VERSION_WIN7 && |
116 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 117 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
117 ash::switches::kForceAshToDesktop)) | 118 ash::switches::kForceAshToDesktop)) |
118 return new AshRemoteWindowTreeHostWin(init_params.remote_hwnd); | 119 return new AshRemoteWindowTreeHostWin(init_params.remote_hwnd); |
119 | 120 |
120 return new AshWindowTreeHostWin(init_params.initial_bounds); | 121 return new AshWindowTreeHostWin(init_params.initial_bounds); |
121 } | 122 } |
122 | 123 |
123 } // namespace ash | 124 } // namespace ash |
OLD | NEW |