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

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

Issue 1390883003: aura: Unify WindowTreeHost for some platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win build Created 5 years, 2 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 | « no previous file | 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 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/ash_window_tree_host_init_params.h" 7 #include "ash/host/ash_window_tree_host_init_params.h"
8 #include "ash/host/ash_window_tree_host_unified.h" 8 #include "ash/host/ash_window_tree_host_unified.h"
9 #include "ash/host/root_window_transformer.h" 9 #include "ash/host/root_window_transformer.h"
10 #include "ash/host/transformer_helper.h" 10 #include "ash/host/transformer_helper.h"
11 #include "ash/ime/input_method_event_handler.h" 11 #include "ash/ime/input_method_event_handler.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/trace_event/trace_event.h" 13 #include "base/trace_event/trace_event.h"
14 #include "ui/aura/window.h" 14 #include "ui/aura/window.h"
15 #include "ui/aura/window_tree_host_ozone.h" 15 #include "ui/aura/window_tree_host_platform.h"
16 #include "ui/events/event_processor.h" 16 #include "ui/events/event_processor.h"
17 #include "ui/events/null_event_targeter.h" 17 #include "ui/events/null_event_targeter.h"
18 #include "ui/gfx/geometry/insets.h" 18 #include "ui/gfx/geometry/insets.h"
19 #include "ui/gfx/transform.h" 19 #include "ui/gfx/transform.h"
20 #include "ui/ozone/public/input_controller.h" 20 #include "ui/ozone/public/input_controller.h"
21 #include "ui/ozone/public/ozone_platform.h" 21 #include "ui/ozone/public/ozone_platform.h"
22 #include "ui/platform_window/platform_window.h" 22 #include "ui/platform_window/platform_window.h"
23 23
24 namespace ash { 24 namespace ash {
25 namespace { 25 namespace {
26 26
27 class AshWindowTreeHostOzone : public AshWindowTreeHost, 27 class AshWindowTreeHostOzone : public AshWindowTreeHost,
28 public aura::WindowTreeHostOzone { 28 public aura::WindowTreeHostPlatform {
29 public: 29 public:
30 explicit AshWindowTreeHostOzone(const gfx::Rect& initial_bounds); 30 explicit AshWindowTreeHostOzone(const gfx::Rect& initial_bounds);
31 ~AshWindowTreeHostOzone() override; 31 ~AshWindowTreeHostOzone() override;
32 32
33 private: 33 private:
34 // AshWindowTreeHost: 34 // AshWindowTreeHost:
35 void ToggleFullScreen() override; 35 void ToggleFullScreen() override;
36 bool ConfineCursorToRootWindow() override; 36 bool ConfineCursorToRootWindow() override;
37 void UnConfineCursor() override; 37 void UnConfineCursor() override;
38 void SetRootWindowTransformer( 38 void SetRootWindowTransformer(
(...skipping 15 matching lines...) Expand all
54 54
55 // Temporarily disable the tap-to-click feature. Used on CrOS. 55 // Temporarily disable the tap-to-click feature. Used on CrOS.
56 void SetTapToClickPaused(bool state); 56 void SetTapToClickPaused(bool state);
57 57
58 TransformerHelper transformer_helper_; 58 TransformerHelper transformer_helper_;
59 59
60 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostOzone); 60 DISALLOW_COPY_AND_ASSIGN(AshWindowTreeHostOzone);
61 }; 61 };
62 62
63 AshWindowTreeHostOzone::AshWindowTreeHostOzone(const gfx::Rect& initial_bounds) 63 AshWindowTreeHostOzone::AshWindowTreeHostOzone(const gfx::Rect& initial_bounds)
64 : aura::WindowTreeHostOzone(initial_bounds), transformer_helper_(this) { 64 : aura::WindowTreeHostPlatform(initial_bounds), transformer_helper_(this) {
65 transformer_helper_.Init(); 65 transformer_helper_.Init();
66 } 66 }
67 67
68 AshWindowTreeHostOzone::~AshWindowTreeHostOzone() { 68 AshWindowTreeHostOzone::~AshWindowTreeHostOzone() {
69 } 69 }
70 70
71 void AshWindowTreeHostOzone::ToggleFullScreen() { 71 void AshWindowTreeHostOzone::ToggleFullScreen() {
72 NOTIMPLEMENTED(); 72 NOTIMPLEMENTED();
73 } 73 }
74 74
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 void AshWindowTreeHostOzone::UpdateRootWindowSize(const gfx::Size& host_size) { 121 void AshWindowTreeHostOzone::UpdateRootWindowSize(const gfx::Size& host_size) {
122 transformer_helper_.UpdateWindowSize(host_size); 122 transformer_helper_.UpdateWindowSize(host_size);
123 } 123 }
124 124
125 void AshWindowTreeHostOzone::OnCursorVisibilityChangedNative(bool show) { 125 void AshWindowTreeHostOzone::OnCursorVisibilityChangedNative(bool show) {
126 SetTapToClickPaused(!show); 126 SetTapToClickPaused(!show);
127 } 127 }
128 128
129 void AshWindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) { 129 void AshWindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) {
130 WindowTreeHostOzone::SetBounds(bounds); 130 WindowTreeHostPlatform::SetBounds(bounds);
131 ConfineCursorToRootWindow(); 131 ConfineCursorToRootWindow();
132 } 132 }
133 133
134 void AshWindowTreeHostOzone::DispatchEvent(ui::Event* event) { 134 void AshWindowTreeHostOzone::DispatchEvent(ui::Event* event) {
135 TRACE_EVENT0("input", "AshWindowTreeHostOzone::DispatchEvent"); 135 TRACE_EVENT0("input", "AshWindowTreeHostOzone::DispatchEvent");
136 if (event->IsLocatedEvent()) 136 if (event->IsLocatedEvent())
137 TranslateLocatedEvent(static_cast<ui::LocatedEvent*>(event)); 137 TranslateLocatedEvent(static_cast<ui::LocatedEvent*>(event));
138 SendEventToProcessor(event); 138 SendEventToProcessor(event);
139 } 139 }
140 140
(...skipping 20 matching lines...) Expand all
161 } // namespace 161 } // namespace
162 162
163 AshWindowTreeHost* AshWindowTreeHost::Create( 163 AshWindowTreeHost* AshWindowTreeHost::Create(
164 const AshWindowTreeHostInitParams& init_params) { 164 const AshWindowTreeHostInitParams& init_params) {
165 if (init_params.offscreen) 165 if (init_params.offscreen)
166 return new AshWindowTreeHostUnified(init_params.initial_bounds); 166 return new AshWindowTreeHostUnified(init_params.initial_bounds);
167 return new AshWindowTreeHostOzone(init_params.initial_bounds); 167 return new AshWindowTreeHostOzone(init_params.initial_bounds);
168 } 168 }
169 169
170 } // namespace ash 170 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/host/ash_window_tree_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698