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

Side by Side Diff: components/mus/public/cpp/lib/window_tree_client_impl.cc

Issue 2021383002: Update WindowTreeClientImpl OnWindowDestroying (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | 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 "components/mus/public/cpp/lib/window_tree_client_impl.h" 5 #include "components/mus/public/cpp/lib/window_tree_client_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 FOR_EACH_OBSERVER(WindowTreeConnectionObserver, observers_, 427 FOR_EACH_OBSERVER(WindowTreeConnectionObserver, observers_,
428 OnWindowTreeFocusChanged(focused, blurred)); 428 OnWindowTreeFocusChanged(focused, blurred));
429 } 429 }
430 430
431 void WindowTreeClientImpl::AddWindow(Window* window) { 431 void WindowTreeClientImpl::AddWindow(Window* window) {
432 DCHECK(windows_.find(server_id(window)) == windows_.end()); 432 DCHECK(windows_.find(server_id(window)) == windows_.end());
433 windows_[server_id(window)] = window; 433 windows_[server_id(window)] = window;
434 } 434 }
435 435
436 void WindowTreeClientImpl::OnWindowDestroying(Window* window) { 436 void WindowTreeClientImpl::OnWindowDestroying(Window* window) {
437 // TODO(jonross): Also clear the focused window (crbug.com/611983)
438 if (window == capture_window_) { 437 if (window == capture_window_) {
439 InFlightCaptureChange reset_change(this, nullptr); 438 // Normally the queue updates itself upon window destruction. However since
440 ApplyServerChangeToExistingInFlightChange(reset_change);
441 // Normally just updating the queued changes is sufficient. However since
sadrul 2016/05/31 18:29:03 Would it be possible to write a test for this chan
jonross 2016/05/31 19:34:01 Pre-existing tests have coverage: MenuRunnerTest.W
442 // |window| is being destroyed, it will not be possible to notify its 439 // |window| is being destroyed, it will not be possible to notify its
443 // observers of the lost capture. Update local state now. 440 // observers of the lost capture. Update local state now.
444 LocalSetCapture(nullptr); 441 LocalSetCapture(nullptr);
445 } 442 }
443 // For |focused_window_| window destruction clears the entire focus state.
446 } 444 }
447 445
448 void WindowTreeClientImpl::OnWindowDestroyed(Window* window) { 446 void WindowTreeClientImpl::OnWindowDestroyed(Window* window) {
449 windows_.erase(server_id(window)); 447 windows_.erase(server_id(window));
450 448
451 for (auto& entry : embedded_windows_) { 449 for (auto& entry : embedded_windows_) {
452 auto it = entry.second.find(window); 450 auto it = entry.second.find(window);
453 if (it != entry.second.end()) { 451 if (it != entry.second.end()) {
454 entry.second.erase(it); 452 entry.second.erase(it);
455 break; 453 break;
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 Window* window, 1127 Window* window,
1130 const gfx::Vector2d& offset, 1128 const gfx::Vector2d& offset,
1131 const gfx::Insets& hit_area) { 1129 const gfx::Insets& hit_area) {
1132 if (window_manager_internal_client_) { 1130 if (window_manager_internal_client_) {
1133 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( 1131 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea(
1134 server_id(window), offset.x(), offset.y(), hit_area); 1132 server_id(window), offset.x(), offset.y(), hit_area);
1135 } 1133 }
1136 } 1134 }
1137 1135
1138 } // namespace mus 1136 } // namespace mus
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