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

Unified Diff: mojo/aura/window_tree_host_mojo.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/aura/window_tree_host_mojo.cc
diff --git a/mojo/aura/window_tree_host_mojo.cc b/mojo/aura/window_tree_host_mojo.cc
index 9f30e139fc76c5bf23c69f9ffcd07626706d8b2d..cd97fa8084e22e4f2cce9707366cb86cb2035a16 100644
--- a/mojo/aura/window_tree_host_mojo.cc
+++ b/mojo/aura/window_tree_host_mojo.cc
@@ -5,6 +5,7 @@
#include "mojo/aura/window_tree_host_mojo.h"
#include "mojo/aura/surface_context_factory.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "ui/aura/env.h"
@@ -19,7 +20,7 @@ namespace mojo {
// WindowTreeHostMojo, public:
WindowTreeHostMojo::WindowTreeHostMojo(Shell* shell, View* view)
- : view_(view), bounds_(view->bounds()) {
+ : view_(view), bounds_(view->bounds().To<gfx::Rect>()) {
view_->AddObserver(this);
context_factory_.reset(new SurfaceContextFactory(shell, view_));
@@ -107,12 +108,14 @@ ui::EventProcessor* WindowTreeHostMojo::GetEventProcessor() {
void WindowTreeHostMojo::OnViewBoundsChanged(
View* view,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) {
- bounds_ = new_bounds;
- if (old_bounds.origin() != new_bounds.origin())
+ const Rect& old_bounds,
+ const Rect& new_bounds) {
+ gfx::Rect old_bounds2 = old_bounds.To<gfx::Rect>();
+ gfx::Rect new_bounds2 = new_bounds.To<gfx::Rect>();
+ bounds_ = new_bounds2;
+ if (old_bounds2.origin() != new_bounds2.origin())
OnHostMoved(bounds_.origin());
- if (old_bounds.size() != new_bounds.size())
+ if (old_bounds2.size() != new_bounds2.size())
OnHostResized(bounds_.size());
}

Powered by Google App Engine
This is Rietveld 408576698