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

Unified Diff: mojo/services/window_manager/window_manager_app.cc

Issue 658923003: Remove dependency on ui from view_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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/services/window_manager/window_manager_app.cc
diff --git a/mojo/services/window_manager/window_manager_app.cc b/mojo/services/window_manager/window_manager_app.cc
index 2852bd273a0e1906256cc11aad33a6859555cc5c..d1ac8d309bf50e4a14fb1aa0d0dc96b3f370d705 100644
--- a/mojo/services/window_manager/window_manager_app.cc
+++ b/mojo/services/window_manager/window_manager_app.cc
@@ -7,6 +7,7 @@
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
#include "mojo/aura/aura_init.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/converters/input_events/input_events_type_converters.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_impl.h"
@@ -179,7 +180,8 @@ void WindowManagerApp::OnEmbed(ViewManager* view_manager,
root_ = root;
window_tree_host_.reset(new WindowTreeHostMojo(shell_, root_));
- window_tree_host_->window()->SetBounds(root->bounds());
+ window_tree_host_->window()->SetBounds(
+ root->bounds().Clone().To<gfx::Rect>());
window_tree_host_->window()->Show();
RegisterSubtree(root_, window_tree_host_->window());
@@ -248,10 +250,10 @@ void WindowManagerApp::OnViewDestroying(View* view) {
}
void WindowManagerApp::OnViewBoundsChanged(View* view,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) {
+ const Rect& old_bounds,
+ const Rect& new_bounds) {
aura::Window* window = GetWindowForViewId(view->id());
- window->SetBounds(new_bounds);
+ window->SetBounds(new_bounds.Clone().To<gfx::Rect>());
}
////////////////////////////////////////////////////////////////////////////////
@@ -312,7 +314,7 @@ void WindowManagerApp::RegisterSubtree(View* view, aura::Window* parent) {
if (view == root_)
window->AddPreTargetHandler(this);
parent->AddChild(window);
- window->SetBounds(view->bounds());
+ window->SetBounds(view->bounds().Clone().To<gfx::Rect>());
window->Show();
view_id_to_window_map_[view->id()] = window;
View::Children::const_iterator it = view->children().begin();

Powered by Google App Engine
This is Rietveld 408576698