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

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

Issue 1462123002: views/mus: Set-up transient windows correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month 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 "components/mus/public/cpp/window.h" 5 #include "components/mus/public/cpp/window.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 // TODO(beng): not necessarily valid to all connections, but possibly to the 263 // TODO(beng): not necessarily valid to all connections, but possibly to the
264 // embeddee in an embedder-embeddee relationship. 264 // embeddee in an embedder-embeddee relationship.
265 if (connection_) 265 if (connection_)
266 CHECK_EQ(child->connection(), connection_); 266 CHECK_EQ(child->connection(), connection_);
267 LocalRemoveChild(child); 267 LocalRemoveChild(child);
268 if (connection_) 268 if (connection_)
269 tree_client()->RemoveChild(child->id(), id_); 269 tree_client()->RemoveChild(child->id(), id_);
270 } 270 }
271 271
272 void Window::AddTransientWindow(Window* transient_window) { 272 void Window::AddTransientWindow(Window* transient_window) {
273 if (connection_)
274 CHECK_EQ(transient_window->connection(), connection_);
275 LocalAddTransientWindow(transient_window); 273 LocalAddTransientWindow(transient_window);
276 if (connection_) 274 if (connection_)
277 tree_client()->AddTransientWindow(this, transient_window->id()); 275 tree_client()->AddTransientWindow(this, transient_window->id());
278 } 276 }
279 277
280 void Window::RemoveTransientWindow(Window* transient_window) { 278 void Window::RemoveTransientWindow(Window* transient_window) {
281 if (connection_)
282 CHECK_EQ(transient_window->connection(), connection_);
283 LocalRemoveTransientWindow(transient_window); 279 LocalRemoveTransientWindow(transient_window);
284 if (connection_) 280 if (connection_)
285 tree_client()->RemoveTransientWindowFromParent(transient_window); 281 tree_client()->RemoveTransientWindowFromParent(transient_window);
286 } 282 }
287 283
288 void Window::MoveToFront() { 284 void Window::MoveToFront() {
289 if (!parent_ || parent_->children_.back() == this) 285 if (!parent_ || parent_->children_.back() == this)
290 return; 286 return;
291 Reorder(parent_->children_.back(), mojom::ORDER_DIRECTION_ABOVE); 287 Reorder(parent_->children_.back(), mojom::ORDER_DIRECTION_ABOVE);
292 } 288 }
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 notifier->NotifyWindowReordered(); 762 notifier->NotifyWindowReordered();
767 763
768 return true; 764 return true;
769 } 765 }
770 766
771 // static 767 // static
772 Window** Window::GetStackingTarget(Window* window) { 768 Window** Window::GetStackingTarget(Window* window) {
773 return &window->stacking_target_; 769 return &window->stacking_target_;
774 } 770 }
775 } // namespace mus 771 } // namespace mus
OLDNEW
« no previous file with comments | « no previous file | components/mus/public/cpp/tests/window_unittest.cc » ('j') | components/mus/ws/default_access_policy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698