| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/mus/bridge/wm_window_mus.h" | 5 #include "ash/mus/bridge/wm_window_mus.h" |
| 6 | 6 |
| 7 #include "ash/common/wm/container_finder.h" | 7 #include "ash/common/wm/container_finder.h" |
| 8 #include "ash/common/wm/window_state.h" | 8 #include "ash/common/wm/window_state.h" |
| 9 #include "ash/common/wm_layout_manager.h" | 9 #include "ash/common/wm_layout_manager.h" |
| 10 #include "ash/common/wm_window_observer.h" | 10 #include "ash/common/wm_window_observer.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 void WmWindowMus::SetName(const char* name) { | 175 void WmWindowMus::SetName(const char* name) { |
| 176 if (name) { | 176 if (name) { |
| 177 window_->SetSharedProperty<std::string>( | 177 window_->SetSharedProperty<std::string>( |
| 178 ::ui::mojom::WindowManager::kName_Property, std::string(name)); | 178 ::ui::mojom::WindowManager::kName_Property, std::string(name)); |
| 179 } else { | 179 } else { |
| 180 window_->ClearSharedProperty(::ui::mojom::WindowManager::kName_Property); | 180 window_->ClearSharedProperty(::ui::mojom::WindowManager::kName_Property); |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 std::string WmWindowMus::GetName() const { |
| 185 return window_->HasSharedProperty(::ui::mojom::WindowManager::kName_Property) |
| 186 ? window_->GetSharedProperty<std::string>( |
| 187 ::ui::mojom::WindowManager::kName_Property) |
| 188 : std::string(); |
| 189 } |
| 190 |
| 184 base::string16 WmWindowMus::GetTitle() const { | 191 base::string16 WmWindowMus::GetTitle() const { |
| 185 return GetWindowTitle(window_); | 192 return GetWindowTitle(window_); |
| 186 } | 193 } |
| 187 | 194 |
| 188 void WmWindowMus::SetShellWindowId(int id) { | 195 void WmWindowMus::SetShellWindowId(int id) { |
| 189 shell_window_id_ = id; | 196 shell_window_id_ = id; |
| 190 } | 197 } |
| 191 | 198 |
| 192 int WmWindowMus::GetShellWindowId() const { | 199 int WmWindowMus::GetShellWindowId() const { |
| 193 return shell_window_id_; | 200 return shell_window_id_; |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 void WmWindowMus::OnWindowDestroying(::ui::Window* window) { | 788 void WmWindowMus::OnWindowDestroying(::ui::Window* window) { |
| 782 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); | 789 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); |
| 783 } | 790 } |
| 784 | 791 |
| 785 void WmWindowMus::OnWindowDestroyed(::ui::Window* window) { | 792 void WmWindowMus::OnWindowDestroyed(::ui::Window* window) { |
| 786 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroyed(this)); | 793 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroyed(this)); |
| 787 } | 794 } |
| 788 | 795 |
| 789 } // namespace mus | 796 } // namespace mus |
| 790 } // namespace ash | 797 } // namespace ash |
| OLD | NEW |