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

Unified Diff: ui/views/mus/native_widget_mus.cc

Issue 1962043002: Move Show and Hide impls from PlatformWindowMus to NativeWidgetMus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | ui/views/mus/platform_window_mus.h » ('j') | ui/views/mus/platform_window_mus.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/native_widget_mus.cc
diff --git a/ui/views/mus/native_widget_mus.cc b/ui/views/mus/native_widget_mus.cc
index 3f2e687781d3d6b8b84772df1b3a4def20fc69e8..7303c7c8a2391e193b7b7279b4dbb5e99b823cfc 100644
--- a/ui/views/mus/native_widget_mus.cc
+++ b/ui/views/mus/native_widget_mus.cc
@@ -711,7 +711,7 @@ std::string NativeWidgetMus::GetWorkspace() const {
}
void NativeWidgetMus::SetBounds(const gfx::Rect& bounds) {
- if (!window_tree_host_)
+ if (!(window_ && window_tree_host_))
return;
gfx::Size size(bounds.size());
@@ -721,6 +721,7 @@ void NativeWidgetMus::SetBounds(const gfx::Rect& bounds) {
size.SetToMin(max_size);
size.SetToMax(min_size);
window_tree_host_->SetBounds(gfx::Rect(bounds.origin(), size));
+ window_->SetBounds(gfx::Rect(bounds.origin(), size));
}
void NativeWidgetMus::SetSize(const gfx::Size& size) {
@@ -771,6 +772,7 @@ void NativeWidgetMus::Hide() {
return;
window_tree_host_->Hide();
+ window_->SetVisible(false);
GetNativeWindow()->Hide();
}
@@ -780,10 +782,11 @@ void NativeWidgetMus::ShowMaximizedWithBounds(
}
void NativeWidgetMus::ShowWithWindowState(ui::WindowShowState state) {
- if (!window_tree_host_)
+ if (!(window_ && window_tree_host_))
return;
window_tree_host_->Show();
+ window_->SetVisible(true);
GetNativeWindow()->Show();
if (native_widget_delegate_->CanActivate()) {
if (state != ui::SHOW_STATE_INACTIVE)
@@ -798,8 +801,8 @@ bool NativeWidgetMus::IsVisible() const {
}
void NativeWidgetMus::Activate() {
- if (window_tree_host_)
- window_tree_host_->platform_window()->Activate();
+ if (window_)
+ window_->SetFocus();
}
void NativeWidgetMus::Deactivate() {
@@ -1121,9 +1124,11 @@ void NativeWidgetMus::OnMusWindowVisibilityChanging(mus::Window* window) {
void NativeWidgetMus::OnMusWindowVisibilityChanged(mus::Window* window) {
if (window->visible()) {
window_tree_host_->Show();
+ window_->SetVisible(true);
GetNativeWindow()->Show();
} else {
window_tree_host_->Hide();
+ window_->SetVisible(false);
GetNativeWindow()->Hide();
}
native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible());
« no previous file with comments | « no previous file | ui/views/mus/platform_window_mus.h » ('j') | ui/views/mus/platform_window_mus.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698