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

Side by Side Diff: ui/aura/mus/window_tree_client.cc

Issue 2714763002: Change FocusSynchronizer to maintain active focus client and window. (Closed)
Patch Set: fix crash in aura_test_helper tear down Created 3 years, 9 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
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 "ui/aura/mus/window_tree_client.h" 5 #include "ui/aura/mus/window_tree_client.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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 transport_value ? std::move(*transport_value) : std::vector<uint8_t>(); 611 transport_value ? std::move(*transport_value) : std::vector<uint8_t>();
612 } 612 }
613 613
614 const uint32_t change_id = ScheduleInFlightChange( 614 const uint32_t change_id = ScheduleInFlightChange(
615 base::MakeUnique<CrashInFlightChange>(window, ChangeType::NEW_WINDOW)); 615 base::MakeUnique<CrashInFlightChange>(window, ChangeType::NEW_WINDOW));
616 tree_->NewWindow(change_id, window->server_id(), 616 tree_->NewWindow(change_id, window->server_id(),
617 std::move(transport_properties)); 617 std::move(transport_properties));
618 } 618 }
619 619
620 void WindowTreeClient::OnWindowMusDestroyed(WindowMus* window, Origin origin) { 620 void WindowTreeClient::OnWindowMusDestroyed(WindowMus* window, Origin origin) {
621 if (focus_synchronizer_->focused_window() == window) 621 if (WindowMus::Get(focus_synchronizer_->focused_window()) == window)
622 focus_synchronizer_->OnFocusedWindowDestroyed(); 622 focus_synchronizer_->OnFocusedWindowDestroyed();
623 623
624 // TODO: decide how to deal with windows not owned by this client. 624 // TODO: decide how to deal with windows not owned by this client.
625 if (origin == Origin::CLIENT && 625 if (origin == Origin::CLIENT &&
626 (WasCreatedByThisClient(window) || IsRoot(window))) { 626 (WasCreatedByThisClient(window) || IsRoot(window))) {
627 const uint32_t change_id = 627 const uint32_t change_id =
628 ScheduleInFlightChange(base::MakeUnique<CrashInFlightChange>( 628 ScheduleInFlightChange(base::MakeUnique<CrashInFlightChange>(
629 window, ChangeType::DELETE_WINDOW)); 629 window, ChangeType::DELETE_WINDOW));
630 tree_->DeleteWindow(change_id, window->server_id()); 630 tree_->DeleteWindow(change_id, window->server_id());
631 } 631 }
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( 1823 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>(
1824 this, capture_synchronizer_.get(), window)); 1824 this, capture_synchronizer_.get(), window));
1825 } 1825 }
1826 1826
1827 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { 1827 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) {
1828 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( 1828 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>(
1829 this, focus_synchronizer_.get(), window)); 1829 this, focus_synchronizer_.get(), window));
1830 } 1830 }
1831 1831
1832 } // namespace aura 1832 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698