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

Side by Side Diff: ash/display/mirror_window_controller.cc

Issue 2631623003: Remove some ifdefs from ash since it only supports ChromeOS now. (Closed)
Patch Set: revert x11 change Created 3 years, 11 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/display/display_util.cc ('k') | 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/display/mirror_window_controller.h" 5 #include "ash/display/mirror_window_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #if defined(USE_X11) 9 #if defined(USE_X11)
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 InitRootWindowSettings(host->window())->display_id = display_info.id(); 193 InitRootWindowSettings(host->window())->display_id = display_info.id();
194 host->InitHost(); 194 host->InitHost();
195 host->window()->Show(); 195 host->window()->Show();
196 #if defined(USE_X11) 196 #if defined(USE_X11)
197 if (!display_manager->IsInUnifiedMode()) { 197 if (!display_manager->IsInUnifiedMode()) {
198 // Mirror window shouldn't handle input events. 198 // Mirror window shouldn't handle input events.
199 static_cast<aura::WindowTreeHostX11*>(host)->DisableInput(); 199 static_cast<aura::WindowTreeHostX11*>(host)->DisableInput();
200 } 200 }
201 #endif 201 #endif
202 202
203 #if defined(OS_CHROMEOS)
204 if (display_manager->IsInUnifiedMode()) { 203 if (display_manager->IsInUnifiedMode()) {
205 host_info->ash_host->ConfineCursorToRootWindow(); 204 host_info->ash_host->ConfineCursorToRootWindow();
206 AshWindowTreeHost* unified_ash_host = 205 AshWindowTreeHost* unified_ash_host =
207 Shell::GetInstance() 206 Shell::GetInstance()
208 ->window_tree_host_manager() 207 ->window_tree_host_manager()
209 ->GetAshWindowTreeHostForDisplayId( 208 ->GetAshWindowTreeHostForDisplayId(
210 display::Screen::GetScreen()->GetPrimaryDisplay().id()); 209 display::Screen::GetScreen()->GetPrimaryDisplay().id());
211 unified_ash_host->RegisterMirroringHost(host_info->ash_host.get()); 210 unified_ash_host->RegisterMirroringHost(host_info->ash_host.get());
212 aura::client::SetScreenPositionClient(host->window(), 211 aura::client::SetScreenPositionClient(host->window(),
213 screen_position_client_.get()); 212 screen_position_client_.get());
214 } 213 }
215 #endif
216 214
217 aura::client::SetCaptureClient(host->window(), new NoneCaptureClient()); 215 aura::client::SetCaptureClient(host->window(), new NoneCaptureClient());
218 host->Show(); 216 host->Show();
219 217
220 aura::Window* mirror_window = host_info->mirror_window = 218 aura::Window* mirror_window = host_info->mirror_window =
221 new aura::Window(nullptr); 219 new aura::Window(nullptr);
222 mirror_window->Init(ui::LAYER_SOLID_COLOR); 220 mirror_window->Init(ui::LAYER_SOLID_COLOR);
223 host->window()->AddChild(mirror_window); 221 host->window()->AddChild(mirror_window);
224 host_info->ash_host->SetRootWindowTransformer(std::move(transformer)); 222 host_info->ash_host->SetRootWindowTransformer(std::move(transformer));
225 mirror_window->SetBounds(host->window()->bounds()); 223 mirror_window->SetBounds(host->window()->bounds());
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 // EventProcessor may be accessed after this call if the mirroring window 372 // EventProcessor may be accessed after this call if the mirroring window
375 // was deleted as a result of input event (e.g. shortcut), so don't delete 373 // was deleted as a result of input event (e.g. shortcut), so don't delete
376 // now. 374 // now.
377 if (delay_host_deletion) 375 if (delay_host_deletion)
378 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info); 376 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info);
379 else 377 else
380 delete host_info; 378 delete host_info;
381 } 379 }
382 380
383 } // namespace ash 381 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698