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

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

Issue 2489513003: Fixes and test updates for aura-mus (Closed)
Patch Set: 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..d60dfea3ec014582e8115fb385d6b0826d63bc29 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.
msw 2016/11/08 23:38:27 optional nit: cite a bug? ditto on line 387
sky 2016/11/09 00:06:01 Done.
+ SetBounds(gfx::Rect(window()->bounds().origin(), size));
}
void DesktopWindowTreeHostMus::StackAbove(aura::Window* window) {
@@ -139,11 +140,14 @@ void DesktopWindowTreeHostMus::StackAtTop() {
void DesktopWindowTreeHostMus::CenterWindow(const gfx::Size& size) {
NOTIMPLEMENTED();
}
+
void DesktopWindowTreeHostMus::GetWindowPlacement(
gfx::Rect* bounds,
ui::WindowShowState* show_state) const {
- NOTIMPLEMENTED();
+ *bounds = GetRestoredBounds();
msw 2016/11/08 23:38:27 q: Why restored bounds? maybe comment?
sky 2016/11/09 00:06:01 Done.
+ *show_state = window()->GetProperty(aura::client::kShowStateKey);
}
+
gfx::Rect DesktopWindowTreeHostMus::GetWindowBoundsInScreen() const {
// TODO: convert to dips.
return GetBounds();
@@ -366,6 +370,33 @@ void DesktopWindowTreeHostMus::SizeConstraintsChanged() {
widget->widget_delegate()->CanResize());
}
+void DesktopWindowTreeHostMus::ShowImpl() {
+ native_widget_delegate_->OnNativeWidgetVisibilityChanging(true);
+ ShowWindowWithState(ui::SHOW_STATE_NORMAL);
msw 2016/11/08 23:38:27 q: Should this ever be showing with the prior stat
sky 2016/11/09 00:06:01 This matches that of DesktopWindowTreeHostX11. I a
+ 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: device scale.
+ 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(

Powered by Google App Engine
This is Rietveld 408576698