OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/wm/user_window_controller_impl.h" | 5 #include "mash/wm/user_window_controller_impl.h" |
6 | 6 |
7 #include "components/mus/public/cpp/property_type_converters.h" | 7 #include "components/mus/public/cpp/property_type_converters.h" |
8 #include "components/mus/public/cpp/window.h" | 8 #include "components/mus/public/cpp/window.h" |
9 #include "components/mus/public/cpp/window_property.h" | 9 #include "components/mus/public/cpp/window_property.h" |
10 #include "mash/wm/public/interfaces/container.mojom.h" | 10 #include "mash/wm/public/interfaces/container.mojom.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 DCHECK(state); | 73 DCHECK(state); |
74 DCHECK(!state_); | 74 DCHECK(!state_); |
75 state_ = state; | 75 state_ = state; |
76 GetUserWindowContainer()->AddObserver(this); | 76 GetUserWindowContainer()->AddObserver(this); |
77 window_title_observer_.reset(new WindowTitleObserver(this)); | 77 window_title_observer_.reset(new WindowTitleObserver(this)); |
78 for (auto iter : GetUserWindowContainer()->children()) | 78 for (auto iter : GetUserWindowContainer()->children()) |
79 iter->AddObserver(window_title_observer_.get()); | 79 iter->AddObserver(window_title_observer_.get()); |
80 } | 80 } |
81 | 81 |
82 mus::Window* UserWindowControllerImpl::GetUserWindowContainer() const { | 82 mus::Window* UserWindowControllerImpl::GetUserWindowContainer() const { |
83 return state_->GetWindowForContainer(mojom::CONTAINER_USER_WINDOWS); | 83 return state_->GetWindowForContainer(mojom::Container::USER_WINDOWS); |
84 } | 84 } |
85 | 85 |
86 void UserWindowControllerImpl::OnTreeChanging(const TreeChangeParams& params) { | 86 void UserWindowControllerImpl::OnTreeChanging(const TreeChangeParams& params) { |
87 DCHECK(state_); | 87 DCHECK(state_); |
88 if (user_window_observer_) { | 88 if (user_window_observer_) { |
89 mus::Window* user_window_container = GetUserWindowContainer(); | 89 mus::Window* user_window_container = GetUserWindowContainer(); |
90 if (params.new_parent == user_window_container) { | 90 if (params.new_parent == user_window_container) { |
91 params.target->AddObserver(window_title_observer_.get()); | 91 params.target->AddObserver(window_title_observer_.get()); |
92 user_window_observer_->OnUserWindowAdded(GetUserWindow(params.target)); | 92 user_window_observer_->OnUserWindowAdded(GetUserWindow(params.target)); |
93 } else if (params.old_parent == user_window_container) { | 93 } else if (params.old_parent == user_window_container) { |
(...skipping 17 matching lines...) Expand all Loading... |
111 } | 111 } |
112 | 112 |
113 void UserWindowControllerImpl::FocusUserWindow(uint32_t window_id) { | 113 void UserWindowControllerImpl::FocusUserWindow(uint32_t window_id) { |
114 mus::Window* window = GetUserWindowContainer()->GetChildById(window_id); | 114 mus::Window* window = GetUserWindowContainer()->GetChildById(window_id); |
115 if (window) | 115 if (window) |
116 window->SetFocus(); | 116 window->SetFocus(); |
117 } | 117 } |
118 | 118 |
119 } // namespace wm | 119 } // namespace wm |
120 } // namespace mash | 120 } // namespace mash |
OLD | NEW |