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

Unified Diff: components/mus/public/cpp/lib/window_tree_client_impl.cc

Issue 1492323003: Updates shadow when active window changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years 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
Index: components/mus/public/cpp/lib/window_tree_client_impl.cc
diff --git a/components/mus/public/cpp/lib/window_tree_client_impl.cc b/components/mus/public/cpp/lib/window_tree_client_impl.cc
index 2b094e96cdc0aa071aa8b3cd18e2d40e3d0b7f0d..2ae19a1a466b5d3bddd9d56c12fec0412e3f3778 100644
--- a/components/mus/public/cpp/lib/window_tree_client_impl.cc
+++ b/components/mus/public/cpp/lib/window_tree_client_impl.cc
@@ -11,6 +11,7 @@
#include "components/mus/public/cpp/window_manager_delegate.h"
#include "components/mus/public/cpp/window_observer.h"
#include "components/mus/public/cpp/window_tree_connection.h"
+#include "components/mus/public/cpp/window_tree_connection_observer.h"
#include "components/mus/public/cpp/window_tree_delegate.h"
#include "mojo/application/public/cpp/application_impl.h"
#include "mojo/application/public/cpp/connect.h"
@@ -353,6 +354,11 @@ void WindowTreeClientImpl::OnEmbedImpl(mojom::WindowTree* window_tree,
focused_window_ = GetWindowById(focused_window_id);
delegate_->OnEmbed(root_);
+
+ if (focused_window_) {
+ FOR_EACH_OBSERVER(WindowTreeConnectionObserver, observers_,
+ OnWindowTreeFocusChanged(focused_window_, nullptr));
+ }
}
////////////////////////////////////////////////////////////////////////////////
@@ -402,6 +408,15 @@ ConnectionSpecificId WindowTreeClientImpl::GetConnectionId() {
////////////////////////////////////////////////////////////////////////////////
// WindowTreeClientImpl, WindowTreeClient implementation:
+void WindowTreeClientImpl::AddObserver(WindowTreeConnectionObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void WindowTreeClientImpl::RemoveObserver(
+ WindowTreeConnectionObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
void WindowTreeClientImpl::OnEmbed(ConnectionSpecificId connection_id,
mojom::WindowDataPtr root_data,
mojom::WindowTreePtr tree,
@@ -595,6 +610,8 @@ void WindowTreeClientImpl::OnWindowFocused(Id focused_window_id) {
FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(focused).observers(),
OnWindowFocusChanged(focused, blurred));
}
+ FOR_EACH_OBSERVER(WindowTreeConnectionObserver, observers_,
+ OnWindowTreeFocusChanged(focused, blurred));
}
void WindowTreeClientImpl::OnChangeCompleted(uint32 change_id, bool success) {
« no previous file with comments | « components/mus/public/cpp/lib/window_tree_client_impl.h ('k') | components/mus/public/cpp/window_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698