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

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

Issue 283603002: Add ability to change display orientation on Ozone (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/host/root_window_transformer.h" 7 #include "ash/host/root_window_transformer.h"
8 #include "ash/host/transformer_helper.h"
8 #include "base/command_line.h" 9 #include "base/command_line.h"
9 #include "ui/aura/window_tree_host_ozone.h" 10 #include "ui/aura/window_tree_host_ozone.h"
10 #include "ui/gfx/geometry/insets.h" 11 #include "ui/gfx/geometry/insets.h"
12 #include "ui/gfx/transform.h"
11 13
12 namespace ash { 14 namespace ash {
13 namespace { 15 namespace {
14 16
15 class AshWindowTreeHostOzone : public AshWindowTreeHost, 17 class AshWindowTreeHostOzone : public AshWindowTreeHost,
16 public aura::WindowTreeHostOzone { 18 public aura::WindowTreeHostOzone {
17 public: 19 public:
18 explicit AshWindowTreeHostOzone(const gfx::Rect& initial_bounds) 20 explicit AshWindowTreeHostOzone(const gfx::Rect& initial_bounds);
19 : aura::WindowTreeHostOzone(initial_bounds) {} 21 virtual ~AshWindowTreeHostOzone();
20 virtual ~AshWindowTreeHostOzone() {}
21 22
22 private: 23 private:
23 // AshWindowTreeHost: 24 // AshWindowTreeHost:
24 virtual void ToggleFullScreen() OVERRIDE { NOTIMPLEMENTED(); } 25 virtual void ToggleFullScreen() OVERRIDE;
25 virtual bool ConfineCursorToRootWindow() OVERRIDE { return false; } 26 virtual bool ConfineCursorToRootWindow() OVERRIDE;
26 virtual void UnConfineCursor() OVERRIDE { NOTIMPLEMENTED(); } 27 virtual void UnConfineCursor() OVERRIDE;
27 virtual void SetRootWindowTransformer( 28 virtual void SetRootWindowTransformer(
28 scoped_ptr<RootWindowTransformer> transformer) OVERRIDE {} 29 scoped_ptr<RootWindowTransformer> transformer) OVERRIDE;
29 virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE { return this; } 30 virtual gfx::Insets GetHostInsets() const OVERRIDE;
31 virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE;
32 virtual void SetRootTransform(const gfx::Transform& transform) OVERRIDE;
33 virtual gfx::Transform GetRootTransform() const OVERRIDE;
34 virtual gfx::Transform GetInverseRootTransform() const OVERRIDE;
35 virtual void UpdateRootWindowSize(const gfx::Size& host_size) OVERRIDE;
36
37 TransformerHelper transformer_helper_;
30 38
31 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostOzone); 39 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostOzone);
32 }; 40 };
33 41
42 AshWindowTreeHostOzone::AshWindowTreeHostOzone(const gfx::Rect& initial_bounds)
43 : aura::WindowTreeHostOzone(initial_bounds),
44 transformer_helper_(this) {}
45
46 AshWindowTreeHostOzone::~AshWindowTreeHostOzone() {}
47
48 void AshWindowTreeHostOzone::ToggleFullScreen() {
49 NOTIMPLEMENTED();
50 }
51
52 bool AshWindowTreeHostOzone::ConfineCursorToRootWindow() {
53 return false;
54 }
55
56 void AshWindowTreeHostOzone::UnConfineCursor() {
57 NOTIMPLEMENTED();
58 }
59
60 void AshWindowTreeHostOzone::SetRootWindowTransformer(
61 scoped_ptr<RootWindowTransformer> transformer) {
62 transformer_helper_.SetRootWindowTransformer(transformer.Pass());
63 }
64
65 gfx::Insets AshWindowTreeHostOzone::GetHostInsets() const {
66 return transformer_helper_.GetHostInsets();
67 }
68
69 aura::WindowTreeHost* AshWindowTreeHostOzone::AsWindowTreeHost() {
70 return this;
71 }
72
73 void AshWindowTreeHostOzone::SetRootTransform(const gfx::Transform& transform) {
74 transformer_helper_.GetTransform();
75 }
76
77 gfx::Transform AshWindowTreeHostOzone::GetRootTransform() const {
78 return transformer_helper_.GetTransform();
79 }
80
81 gfx::Transform AshWindowTreeHostOzone::GetInverseRootTransform() const {
82 return transformer_helper_.GetInverseTransform();
83 }
84
85 void AshWindowTreeHostOzone::UpdateRootWindowSize(const gfx::Size& host_size) {
86 transformer_helper_.UpdateWindowSize(host_size);
87 }
88
34 } // namespace 89 } // namespace
35 90
36 AshWindowTreeHost* AshWindowTreeHost::Create(const gfx::Rect& initial_bounds) { 91 AshWindowTreeHost* AshWindowTreeHost::Create(const gfx::Rect& initial_bounds) {
37 return new AshWindowTreeHostOzone(initial_bounds); 92 return new AshWindowTreeHostOzone(initial_bounds);
38 } 93 }
39 94
40 } // namespace ash 95 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698