Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: ash/common/wm_window.cc

Issue 2798333005: Moves WmWindow::GetInternalWidget() into a standalone function (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/wm_window.h ('k') | ash/wm/widget_finder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « ash/common/wm_window.h ('k') | ash/wm/widget_finder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698