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 = window->GetLocalProperty(kNativeWidgetMusKey)
; |
| 385 if (!native_widget) |
| 386 return nullptr; |
| 387 return native_widget->GetWidget(); |
| 388 } |
| 389 |
380 aura::Window* NativeWidgetMus::GetRootWindow() { | 390 aura::Window* NativeWidgetMus::GetRootWindow() { |
381 return window_tree_host_->window(); | 391 return window_tree_host_->window(); |
382 } | 392 } |
383 | 393 |
384 void NativeWidgetMus::OnPlatformWindowClosed() { | 394 void NativeWidgetMus::OnPlatformWindowClosed() { |
385 native_widget_delegate_->OnNativeWidgetDestroying(); | 395 native_widget_delegate_->OnNativeWidgetDestroying(); |
386 | 396 |
387 window_tree_client_.reset(); // Uses |content_|. | 397 window_tree_client_.reset(); // Uses |content_|. |
388 capture_client_.reset(); // Uses |content_|. | 398 capture_client_.reset(); // Uses |content_|. |
389 | 399 |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 window_tree_host_->Show(); | 1131 window_tree_host_->Show(); |
1122 GetNativeWindow()->Show(); | 1132 GetNativeWindow()->Show(); |
1123 } else { | 1133 } else { |
1124 window_tree_host_->Hide(); | 1134 window_tree_host_->Hide(); |
1125 GetNativeWindow()->Hide(); | 1135 GetNativeWindow()->Hide(); |
1126 } | 1136 } |
1127 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); | 1137 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); |
1128 } | 1138 } |
1129 | 1139 |
1130 } // namespace views | 1140 } // namespace views |
OLD | NEW |