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

Unified Diff: mojo/examples/wm_flow/wm/frame_controller.cc

Issue 658923003: Remove dependency on ui from view_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase Created 6 years, 2 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
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..35ea7b485ccdc0af8f53036c9172a2223481454f 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().To<gfx::Rect>();
maximized_ = !maximized_;
if (maximized_)
view_->SetBounds(view_->parent()->bounds());
else
- view_->SetBounds(restored_bounds_);
+ view_->SetBounds(*mojo::Rect::From(restored_bounds_));
}
void FrameController::ActivateWindow() {

Powered by Google App Engine
This is Rietveld 408576698