Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Side by Side Diff: ash/host/ash_window_tree_host_unified.cc

Issue 1119953002: Enable display rotation, magnifier in unified desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/host/ash_window_tree_host_unified.h ('k') | ash/host/ash_window_tree_host_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_unified.h" 5 #include "ash/host/ash_window_tree_host_unified.h"
6 #include "ash/host/root_window_transformer.h" 6 #include "ash/host/root_window_transformer.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura/window_event_dispatcher.h" 9 #include "ui/aura/window_event_dispatcher.h"
10 #include "ui/aura/window_targeter.h" 10 #include "ui/aura/window_targeter.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 aura::Window* src_root_; 42 aura::Window* src_root_;
43 aura::Window* dst_root_; 43 aura::Window* dst_root_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(UnifiedEventTargeter); 45 DISALLOW_COPY_AND_ASSIGN(UnifiedEventTargeter);
46 }; 46 };
47 47
48 AshWindowTreeHostUnified::AshWindowTreeHostUnified( 48 AshWindowTreeHostUnified::AshWindowTreeHostUnified(
49 const gfx::Rect& initial_bounds) 49 const gfx::Rect& initial_bounds)
50 : bounds_(gfx::Rect(initial_bounds.size())) { 50 : bounds_(gfx::Rect(initial_bounds.size())), transformer_helper_(this) {
51 CreateCompositor(GetAcceleratedWidget()); 51 CreateCompositor(GetAcceleratedWidget());
52 transformer_helper_.Init();
oshima 2015/05/01 04:11:18 Initialize transformer_helper requires window(), w
52 } 53 }
53 54
54 AshWindowTreeHostUnified::~AshWindowTreeHostUnified() { 55 AshWindowTreeHostUnified::~AshWindowTreeHostUnified() {
55 DestroyCompositor(); 56 DestroyCompositor();
56 DestroyDispatcher(); 57 DestroyDispatcher();
57 } 58 }
58 59
59 void AshWindowTreeHostUnified::PrepareForShutdown() { 60 void AshWindowTreeHostUnified::PrepareForShutdown() {
60 window()->SetEventTargeter( 61 window()->SetEventTargeter(
61 scoped_ptr<ui::EventTargeter>(new ui::NullEventTargeter)); 62 scoped_ptr<ui::EventTargeter>(new ui::NullEventTargeter));
(...skipping 18 matching lines...) Expand all
80 81
81 bool AshWindowTreeHostUnified::ConfineCursorToRootWindow() { 82 bool AshWindowTreeHostUnified::ConfineCursorToRootWindow() {
82 return true; 83 return true;
83 } 84 }
84 85
85 void AshWindowTreeHostUnified::UnConfineCursor() { 86 void AshWindowTreeHostUnified::UnConfineCursor() {
86 } 87 }
87 88
88 void AshWindowTreeHostUnified::SetRootWindowTransformer( 89 void AshWindowTreeHostUnified::SetRootWindowTransformer(
89 scoped_ptr<RootWindowTransformer> transformer) { 90 scoped_ptr<RootWindowTransformer> transformer) {
90 // TODO(oshima): Find out if this is neceessary. 91 transformer_helper_.SetRootWindowTransformer(transformer.Pass());
91 NOTIMPLEMENTED();
92 } 92 }
93 93
94 gfx::Insets AshWindowTreeHostUnified::GetHostInsets() const { 94 gfx::Insets AshWindowTreeHostUnified::GetHostInsets() const {
95 return gfx::Insets(); 95 return transformer_helper_.GetHostInsets();
96 } 96 }
97 97
98 aura::WindowTreeHost* AshWindowTreeHostUnified::AsWindowTreeHost() { 98 aura::WindowTreeHost* AshWindowTreeHostUnified::AsWindowTreeHost() {
99 return this; 99 return this;
100 } 100 }
101 101
102 ui::EventSource* AshWindowTreeHostUnified::GetEventSource() { 102 ui::EventSource* AshWindowTreeHostUnified::GetEventSource() {
103 return this; 103 return this;
104 } 104 }
105 105
(...skipping 11 matching lines...) Expand all
117 return bounds_; 117 return bounds_;
118 } 118 }
119 119
120 void AshWindowTreeHostUnified::SetBounds(const gfx::Rect& bounds) { 120 void AshWindowTreeHostUnified::SetBounds(const gfx::Rect& bounds) {
121 if (bounds_.size() == bounds.size()) 121 if (bounds_.size() == bounds.size())
122 return; 122 return;
123 bounds_.set_size(bounds.size()); 123 bounds_.set_size(bounds.size());
124 OnHostResized(bounds_.size()); 124 OnHostResized(bounds_.size());
125 } 125 }
126 126
127 gfx::Transform AshWindowTreeHostUnified::GetRootTransform() const {
128 return transformer_helper_.GetTransform();
129 }
130
131 void AshWindowTreeHostUnified::SetRootTransform(
132 const gfx::Transform& transform) {
133 transformer_helper_.SetTransform(transform);
134 }
135
136 gfx::Transform AshWindowTreeHostUnified::GetInverseRootTransform() const {
137 return transformer_helper_.GetInverseTransform();
138 }
139
140 void AshWindowTreeHostUnified::UpdateRootWindowSize(
141 const gfx::Size& host_size) {
142 transformer_helper_.UpdateWindowSize(host_size);
143 }
144
127 void AshWindowTreeHostUnified::SetCapture() { 145 void AshWindowTreeHostUnified::SetCapture() {
128 } 146 }
129 147
130 void AshWindowTreeHostUnified::ReleaseCapture() { 148 void AshWindowTreeHostUnified::ReleaseCapture() {
131 } 149 }
132 150
133 gfx::Point AshWindowTreeHostUnified::GetLocationOnNativeScreen() const { 151 gfx::Point AshWindowTreeHostUnified::GetLocationOnNativeScreen() const {
134 return gfx::Point(); 152 return gfx::Point();
135 } 153 }
136 154
(...skipping 21 matching lines...) Expand all
158 DCHECK(iter != mirroring_hosts_.end()); 176 DCHECK(iter != mirroring_hosts_.end());
159 window->RemoveObserver(this); 177 window->RemoveObserver(this);
160 mirroring_hosts_.erase(iter); 178 mirroring_hosts_.erase(iter);
161 } 179 }
162 180
163 ui::EventProcessor* AshWindowTreeHostUnified::GetEventProcessor() { 181 ui::EventProcessor* AshWindowTreeHostUnified::GetEventProcessor() {
164 return dispatcher(); 182 return dispatcher();
165 } 183 }
166 184
167 } // namespace ash 185 } // namespace ash
OLDNEW
« no previous file with comments | « ash/host/ash_window_tree_host_unified.h ('k') | ash/host/ash_window_tree_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698