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

Unified Diff: mojo/examples/window_manager/window_manager.cc

Issue 347433003: Fix incorrect position of Native Viewport contents on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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
« no previous file with comments | « no previous file | mojo/services/native_viewport/native_viewport_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/window_manager/window_manager.cc
diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc
index a96becea6e640b0c835265b296afa09e7c10eb60..e812df9e01a9e9e5bf647993f365819169f0d6e8 100644
--- a/mojo/examples/window_manager/window_manager.cc
+++ b/mojo/examples/window_manager/window_manager.cc
@@ -87,8 +87,6 @@ class WindowManager : public Application,
CreateWindow(kEmbeddedAppURL);
else if (event->flags & ui::EF_RIGHT_MOUSE_BUTTON)
CreateWindow(kNestingAppURL);
- else if (event->flags & ui::EF_MIDDLE_MOUSE_BUTTON)
- CreateWindow(kMojoBrowserURL);
}
}
@@ -106,15 +104,18 @@ class WindowManager : public Application,
node->SetActiveView(view);
view->SetColor(SK_ColorBLUE);
view->AddObserver(this);
+
+ CreateWindow(kMojoBrowserURL);
}
void CreateWindow(const std::string& url) {
Node* node = view_manager_->GetNodeById(parent_node_id_);
- gfx::Rect bounds(50, 50, 400, 400);
+ gfx::Rect bounds(node->bounds().size());
+ bounds.Inset(25, 25);
if (!node->children().empty()) {
gfx::Point position = node->children().back()->bounds().origin();
- position.Offset(50, 50);
+ position.Offset(25, 25);
bounds.set_origin(position);
}
« no previous file with comments | « no previous file | mojo/services/native_viewport/native_viewport_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698