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

Unified Diff: ui/wm/core/transient_window_manager.cc

Issue 2453953003: Moves TransientWindowClient to ui/aura/client and adds observer (Closed)
Patch Set: merge Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/wm/core/transient_window_controller.cc ('k') | ui/wm/core/transient_window_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/transient_window_manager.cc
diff --git a/ui/wm/core/transient_window_manager.cc b/ui/wm/core/transient_window_manager.cc
index 6a829ed6a87259a170aa53fdea0a20adf69690ea..3145c341d29bebb4ee43b19ade0e5bdede7ccc7c 100644
--- a/ui/wm/core/transient_window_manager.cc
+++ b/ui/wm/core/transient_window_manager.cc
@@ -9,9 +9,11 @@
#include "base/auto_reset.h"
#include "base/stl_util.h"
+#include "ui/aura/client/transient_window_client_observer.h"
#include "ui/aura/window.h"
#include "ui/aura/window_property.h"
#include "ui/aura/window_tracker.h"
+#include "ui/wm/core/transient_window_controller.h"
#include "ui/wm/core/transient_window_observer.h"
#include "ui/wm/core/transient_window_stacking_client.h"
#include "ui/wm/core/window_util.h"
@@ -67,6 +69,11 @@ void TransientWindowManager::AddTransientChild(Window* child) {
transient_children_.push_back(child);
child_manager->transient_parent_ = window_;
+ for (aura::client::TransientWindowClientObserver& observer :
+ TransientWindowController::Get()->observers_) {
+ observer.OnTransientChildWindowAdded(window_, child);
+ }
+
// Restack |child| properly above its transient parent, if they share the same
// parent.
if (child->parent() == window_->parent())
@@ -83,7 +90,12 @@ void TransientWindowManager::RemoveTransientChild(Window* child) {
transient_children_.erase(i);
TransientWindowManager* child_manager = Get(child);
DCHECK_EQ(window_, child_manager->transient_parent_);
- child_manager->transient_parent_ = NULL;
+ child_manager->transient_parent_ = nullptr;
+
+ for (aura::client::TransientWindowClientObserver& observer :
+ TransientWindowController::Get()->observers_) {
+ observer.OnTransientChildWindowRemoved(window_, child);
+ }
// If |child| and its former transient parent share the same parent, |child|
// should be restacked properly so it is not among transient children of its
« no previous file with comments | « ui/wm/core/transient_window_controller.cc ('k') | ui/wm/core/transient_window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698