Index: ash/common/wm_window.cc |
diff --git a/ash/common/wm_window.cc b/ash/common/wm_window.cc |
index 0232ff892b4c4109eee14f2e2e6f3a648303d45e..31923d91e43bf18cfd941fafff93b5369be22af3 100644 |
--- a/ash/common/wm_window.cc |
+++ b/ash/common/wm_window.cc |
@@ -16,6 +16,7 @@ |
#include "ash/shell.h" |
#include "ash/wm/resize_handle_window_targeter.h" |
#include "ash/wm/resize_shadow_controller.h" |
+#include "ash/wm/widget_finder.h" |
#include "ash/wm/window_animations.h" |
#include "ash/wm/window_mirror_view.h" |
#include "ash/wm/window_properties.h" |
@@ -578,13 +579,6 @@ void WmWindow::Show() { |
window_->Show(); |
} |
-views::Widget* WmWindow::GetInternalWidget() { |
- return window_->GetProperty(kWidgetCreationTypeKey) == |
- WidgetCreationType::INTERNAL |
- ? views::Widget::GetWidgetForNativeView(window_) |
- : nullptr; |
-} |
- |
void WmWindow::CloseWidget() { |
if (WmShell::Get()->IsRunningInMash() && |
aura_window()->GetProperty(kWidgetCreationTypeKey) == |
@@ -596,8 +590,9 @@ void WmWindow::CloseWidget() { |
Shell::window_manager_client()->RequestClose(aura_window()); |
return; |
} |
- DCHECK(GetInternalWidget()); |
- GetInternalWidget()->Close(); |
+ views::Widget* widget = GetInternalWidgetForWindow(window_); |
+ DCHECK(widget); |
+ widget->Close(); |
} |
void WmWindow::SetFocused() { |