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

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

Issue 2489513003: Fixes and test updates for aura-mus (Closed)
Patch Set: feedback Created 4 years, 1 month 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
Index: ui/views/mus/desktop_window_tree_host_mus.cc
diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc
index 2001ba1b34d428e91189c5edb93d204726a576a4..db87c48ea65c1ff2ae47dc0fddb50076643469ab 100644
--- a/ui/views/mus/desktop_window_tree_host_mus.cc
+++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -125,7 +125,8 @@ bool DesktopWindowTreeHostMus::IsVisible() const {
}
void DesktopWindowTreeHostMus::SetSize(const gfx::Size& size) {
- window()->SetBounds(gfx::Rect(window()->bounds().origin(), size));
+ // TODO: handle device scale, http://crbug.com/663524.
+ SetBounds(gfx::Rect(window()->bounds().origin(), size));
}
void DesktopWindowTreeHostMus::StackAbove(aura::Window* window) {
@@ -139,13 +140,17 @@ void DesktopWindowTreeHostMus::StackAtTop() {
void DesktopWindowTreeHostMus::CenterWindow(const gfx::Size& size) {
NOTIMPLEMENTED();
}
+
void DesktopWindowTreeHostMus::GetWindowPlacement(
gfx::Rect* bounds,
ui::WindowShowState* show_state) const {
- NOTIMPLEMENTED();
+ // Implementation matches that of NativeWidgetAura.
+ *bounds = GetRestoredBounds();
+ *show_state = window()->GetProperty(aura::client::kShowStateKey);
}
+
gfx::Rect DesktopWindowTreeHostMus::GetWindowBoundsInScreen() const {
- // TODO: convert to dips.
+ // TODO: convert to dips, http://crbug.com/663524.
return GetBounds();
}
@@ -366,6 +371,34 @@ void DesktopWindowTreeHostMus::SizeConstraintsChanged() {
widget->widget_delegate()->CanResize());
}
+void DesktopWindowTreeHostMus::ShowImpl() {
+ native_widget_delegate_->OnNativeWidgetVisibilityChanging(true);
+ // Using ui::SHOW_STATE_NORMAL matches that of DesktopWindowTreeHostX11.
+ ShowWindowWithState(ui::SHOW_STATE_NORMAL);
+ WindowTreeHostMus::ShowImpl();
+ native_widget_delegate_->OnNativeWidgetVisibilityChanged(true);
+}
+
+void DesktopWindowTreeHostMus::HideImpl() {
+ native_widget_delegate_->OnNativeWidgetVisibilityChanging(false);
+ WindowTreeHostMus::HideImpl();
+ native_widget_delegate_->OnNativeWidgetVisibilityChanged(false);
+}
+
+void DesktopWindowTreeHostMus::SetBounds(const gfx::Rect& bounds_in_pixels) {
+ // TODO: handle conversion to dips, http://crbug.com/663524.
+ gfx::Rect final_bounds_in_pixels = bounds_in_pixels;
+ if (GetBounds().size() != bounds_in_pixels.size()) {
+ gfx::Size size = bounds_in_pixels.size();
+ size.SetToMax(native_widget_delegate_->GetMinimumSize());
+ const gfx::Size max_size = native_widget_delegate_->GetMaximumSize();
+ if (!max_size.IsEmpty())
+ size.SetToMin(max_size);
+ final_bounds_in_pixels.set_size(size);
+ }
+ WindowTreeHostPlatform::SetBounds(final_bounds_in_pixels);
+}
+
void DesktopWindowTreeHostMus::OnWindowInitialized(aura::Window* window) {}
void DesktopWindowTreeHostMus::OnActiveFocusClientChanged(
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.h ('k') | ui/views/touchui/touch_selection_menu_runner_views_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698