Index: mojo/examples/wm_flow/wm/frame_controller.cc |
diff --git a/mojo/examples/wm_flow/wm/frame_controller.cc b/mojo/examples/wm_flow/wm/frame_controller.cc |
index 40ff0413deb773dc8e6a1c2f7c66eb8a0b11017e..5e2cc5272cdb2f3fab7eceff758071c12c88cfb6 100644 |
--- a/mojo/examples/wm_flow/wm/frame_controller.cc |
+++ b/mojo/examples/wm_flow/wm/frame_controller.cc |
@@ -6,6 +6,7 @@ |
#include "base/macros.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "mojo/converters/geometry/geometry_type_converters.h" |
#include "mojo/services/public/cpp/view_manager/view.h" |
#include "mojo/services/window_manager/window_manager_app.h" |
#include "mojo/views/native_widget_view_manager.h" |
@@ -50,7 +51,7 @@ class FrameController::LayoutManager : public views::LayoutManager, |
bounds.Inset(kFrameSize, |
close_button_->bounds().bottom() + kButtonFrameMargin, |
kFrameSize, kFrameSize); |
- controller_->app_view_->SetBounds(bounds); |
+ controller_->app_view_->SetBounds(*mojo::Rect::From(bounds)); |
} |
virtual gfx::Size GetPreferredSize(const views::View* host) const override { |
return gfx::Size(); |
@@ -120,7 +121,8 @@ FrameController::FrameController( |
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
params.native_widget = |
new mojo::NativeWidgetViewManager(widget_, shell, view_); |
- params.bounds = gfx::Rect(view_->bounds().size()); |
+ params.bounds = gfx::Rect( |
+ 0, 0, view_->bounds().width, view_->bounds().height); |
widget_->Init(params); |
widget_->SetContentsView(frame_view_); |
widget_->Show(); |
@@ -135,12 +137,12 @@ void FrameController::CloseWindow() { |
void FrameController::ToggleMaximize() { |
if (!maximized_) |
- restored_bounds_ = view_->bounds(); |
+ restored_bounds_ = view_->bounds().Clone().To<gfx::Rect>(); |
Ben Goodger (Google)
2014/10/23 15:11:08
this is the weirdness
jam
2014/10/23 15:19:53
I agree. Let me check with others why the To metho
jam
2014/10/23 20:49:48
I've made the generated struct have a To() method
|
maximized_ = !maximized_; |
if (maximized_) |
view_->SetBounds(view_->parent()->bounds()); |
else |
- view_->SetBounds(restored_bounds_); |
+ view_->SetBounds(*mojo::Rect::From(restored_bounds_)); |
} |
void FrameController::ActivateWindow() { |