| 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 "ui/views/mus/native_widget_mus.h" | 5 #include "ui/views/mus/native_widget_mus.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
| 9 #include "components/mus/public/cpp/property_type_converters.h" | 9 #include "components/mus/public/cpp/property_type_converters.h" |
| 10 #include "components/mus/public/cpp/window.h" | 10 #include "components/mus/public/cpp/window.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 NativeWidgetMus* native_widget = | 370 NativeWidgetMus* native_widget = |
| 371 window->GetLocalProperty(kNativeWidgetMusKey); | 371 window->GetLocalProperty(kNativeWidgetMusKey); |
| 372 if (native_widget && native_widget->GetWidget()->non_client_view()) { | 372 if (native_widget && native_widget->GetWidget()->non_client_view()) { |
| 373 native_widget->GetWidget()->non_client_view()->Layout(); | 373 native_widget->GetWidget()->non_client_view()->Layout(); |
| 374 native_widget->GetWidget()->non_client_view()->SchedulePaint(); | 374 native_widget->GetWidget()->non_client_view()->SchedulePaint(); |
| 375 native_widget->UpdateClientArea(); | 375 native_widget->UpdateClientArea(); |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 | 379 |
| 380 // static |
| 381 Widget* NativeWidgetMus::GetWidgetForWindow(mus::Window* window) { |
| 382 if (!window) |
| 383 return nullptr; |
| 384 NativeWidgetMus* native_widget = |
| 385 window->GetLocalProperty(kNativeWidgetMusKey); |
| 386 if (!native_widget) |
| 387 return nullptr; |
| 388 return native_widget->GetWidget(); |
| 389 } |
| 390 |
| 380 aura::Window* NativeWidgetMus::GetRootWindow() { | 391 aura::Window* NativeWidgetMus::GetRootWindow() { |
| 381 return window_tree_host_->window(); | 392 return window_tree_host_->window(); |
| 382 } | 393 } |
| 383 | 394 |
| 384 void NativeWidgetMus::OnPlatformWindowClosed() { | 395 void NativeWidgetMus::OnPlatformWindowClosed() { |
| 385 native_widget_delegate_->OnNativeWidgetDestroying(); | 396 native_widget_delegate_->OnNativeWidgetDestroying(); |
| 386 | 397 |
| 387 window_tree_client_.reset(); // Uses |content_|. | 398 window_tree_client_.reset(); // Uses |content_|. |
| 388 capture_client_.reset(); // Uses |content_|. | 399 capture_client_.reset(); // Uses |content_|. |
| 389 | 400 |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 window_tree_host_->Show(); | 1134 window_tree_host_->Show(); |
| 1124 GetNativeWindow()->Show(); | 1135 GetNativeWindow()->Show(); |
| 1125 } else { | 1136 } else { |
| 1126 window_tree_host_->Hide(); | 1137 window_tree_host_->Hide(); |
| 1127 GetNativeWindow()->Hide(); | 1138 GetNativeWindow()->Hide(); |
| 1128 } | 1139 } |
| 1129 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); | 1140 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); |
| 1130 } | 1141 } |
| 1131 | 1142 |
| 1132 } // namespace views | 1143 } // namespace views |
| OLD | NEW |