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

Unified Diff: mash/wm/window_manager_impl.cc

Issue 1576683002: Add rudimentary mash shelf functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 years, 11 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
« mash/wm/window_manager_impl.h ('K') | « mash/wm/window_manager_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/window_manager_impl.cc
diff --git a/mash/wm/window_manager_impl.cc b/mash/wm/window_manager_impl.cc
index 5195c1f7786b0933440673b6dc632004cc40226a..84e5b2f89cb0a2084102c17f672cdaa09f149663 100644
--- a/mash/wm/window_manager_impl.cc
+++ b/mash/wm/window_manager_impl.cc
@@ -123,6 +123,15 @@ void WindowManagerImpl::OnTreeChanging(const TreeChangeParams& params) {
params.target->RemoveObserver(this);
else if (state_->WindowIsContainer(params.new_parent))
params.target->AddObserver(this);
+
+ if (user_window_observer_) {
+ mus::Window* user_window_container =
+ state_->GetWindowForContainer(mojom::CONTAINER_USER_WINDOWS);
+ if (params.new_parent == user_window_container)
+ user_window_observer_->OnUserWindowAdded(params.target->id());
+ else if (params.old_parent == user_window_container)
+ user_window_observer_->OnUserWindowRemoved(params.target->id());
+ }
}
void WindowManagerImpl::OnWindowEmbeddedAppDisconnected(mus::Window* window) {
@@ -167,6 +176,20 @@ void WindowManagerImpl::GetConfig(const GetConfigCallback& callback) {
callback.Run(std::move(config));
}
+void WindowManagerImpl::AddUserWindowObserver(
+ mus::mojom::UserWindowObserverPtr observer) {
+ // TODO(msw): Support multiple observers.
+ user_window_observer_ = std::move(observer);
+}
+
+void WindowManagerImpl::FocusUserWindow(uint32_t window_id) {
+ mus::Window* container =
+ state_->GetWindowForContainer(mojom::CONTAINER_USER_WINDOWS);
+ mus::Window* window = container->GetChildById(window_id);
+ if (window)
+ window->SetFocus();
+}
+
bool WindowManagerImpl::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) {
// By returning true the bounds of |window| is updated.
return true;
« mash/wm/window_manager_impl.h ('K') | « mash/wm/window_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698