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

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

Issue 1113493002: Don't dispatch event after shutdown on AshWTHUnified (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/display/display_controller.cc ('k') | ash/host/ash_window_tree_host_unified.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 (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 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 10
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 aura::client::SetCaptureClient(host->window(), new NoneCaptureClient()); 138 aura::client::SetCaptureClient(host->window(), new NoneCaptureClient());
139 host->Show(); 139 host->Show();
140 140
141 aura::Window* mirror_window = host_info->mirror_window = 141 aura::Window* mirror_window = host_info->mirror_window =
142 new aura::Window(nullptr); 142 new aura::Window(nullptr);
143 mirror_window->Init(ui::LAYER_SOLID_COLOR); 143 mirror_window->Init(ui::LAYER_SOLID_COLOR);
144 host->window()->AddChild(mirror_window); 144 host->window()->AddChild(mirror_window);
145 mirror_window->SetBounds(host->window()->bounds()); 145 mirror_window->SetBounds(host->window()->bounds());
146 mirror_window->Show(); 146 mirror_window->Show();
147 if (reflector_) { 147 if (reflector_) {
148 // TODO(oshima): Enable this once reflect change is landed. 148 // TODO(oshima): Enable this once reflector change is landed.
149 // reflector_->AddMirroringLayer(mirror_window->layer()); 149 // reflector_->AddMirroringLayer(mirror_window->layer());
150 } else { 150 } else {
151 reflector_ = 151 reflector_ =
152 aura::Env::GetInstance()->context_factory()->CreateReflector( 152 aura::Env::GetInstance()->context_factory()->CreateReflector(
153 Shell::GetPrimaryRootWindow()->GetHost()->compositor(), 153 Shell::GetPrimaryRootWindow()->GetHost()->compositor(),
154 mirror_window->layer()); 154 mirror_window->layer());
155 } 155 }
156 } else { 156 } else {
157 aura::WindowTreeHost* host = mirroring_host_info_map_[display_info.id()] 157 aura::WindowTreeHost* host = mirroring_host_info_map_[display_info.id()]
158 ->ash_host->AsWindowTreeHost(); 158 ->ash_host->AsWindowTreeHost();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 void MirrorWindowController::CloseAndDeleteHost(MirroringHostInfo* host_info) { 261 void MirrorWindowController::CloseAndDeleteHost(MirroringHostInfo* host_info) {
262 aura::WindowTreeHost* host = host_info->ash_host->AsWindowTreeHost(); 262 aura::WindowTreeHost* host = host_info->ash_host->AsWindowTreeHost();
263 NoneCaptureClient* capture_client = static_cast<NoneCaptureClient*>( 263 NoneCaptureClient* capture_client = static_cast<NoneCaptureClient*>(
264 aura::client::GetCaptureClient(host->window())); 264 aura::client::GetCaptureClient(host->window()));
265 aura::client::SetCaptureClient(host->window(), NULL); 265 aura::client::SetCaptureClient(host->window(), NULL);
266 delete capture_client; 266 delete capture_client;
267 267
268 host->RemoveObserver(Shell::GetInstance()->display_controller()); 268 host->RemoveObserver(Shell::GetInstance()->display_controller());
269 host->RemoveObserver(this); 269 host->RemoveObserver(this);
270 // reflector_->RemoveMirroringLayer(host_info->mirror_window->layer()); 270 host_info->ash_host->PrepareForShutdown();
271 // TODO(oshima): Enable this once reflector change is landed.
272 // reflector_->RemovedMirroringLayer(mirror_window->layer());
271 delete host_info; 273 delete host_info;
272 } 274 }
273 275
274 scoped_ptr<RootWindowTransformer> 276 scoped_ptr<RootWindowTransformer>
275 MirrorWindowController::CreateRootWindowTransformer() const { 277 MirrorWindowController::CreateRootWindowTransformer() const {
276 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 278 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
277 const DisplayInfo& mirror_display_info = 279 const DisplayInfo& mirror_display_info =
278 display_manager->GetDisplayInfo(display_manager->mirroring_display_id()); 280 display_manager->GetDisplayInfo(display_manager->mirroring_display_id());
279 const DisplayInfo& source_display_info = display_manager->GetDisplayInfo( 281 const DisplayInfo& source_display_info = display_manager->GetDisplayInfo(
280 Shell::GetScreen()->GetPrimaryDisplay().id()); 282 Shell::GetScreen()->GetPrimaryDisplay().id());
281 DCHECK(display_manager->IsInMirrorMode()); 283 DCHECK(display_manager->IsInMirrorMode());
282 return scoped_ptr<RootWindowTransformer>( 284 return scoped_ptr<RootWindowTransformer>(
283 CreateRootWindowTransformerForMirroredDisplay(source_display_info, 285 CreateRootWindowTransformerForMirroredDisplay(source_display_info,
284 mirror_display_info)); 286 mirror_display_info));
285 } 287 }
286 288
287 } // namespace ash 289 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/host/ash_window_tree_host_unified.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698