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

Unified Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 510001: [Mac] Implement WindowSizer::GetDefaultPopupOrigin()... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 12 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 | chrome/browser/window_sizer_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 35456)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -19,6 +19,7 @@
#include "chrome/browser/encoding_menu_controller.h"
#include "chrome/browser/location_bar.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/window_sizer.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
@@ -252,6 +253,15 @@
windowRect.set_width(minSize.width);
if (windowRect.height() < minSize.height)
windowRect.set_height(minSize.height);
+
+ // When we are given x/y coordinates of 0 on a created popup window, assume
+ // none were given by the window.open() command.
+ if (browser_->type() & Browser::TYPE_POPUP &&
+ windowRect.x() == 0 && windowRect.y() == 0) {
+ gfx::Size size = windowRect.size();
+ windowRect.set_origin(WindowSizer::GetDefaultPopupOrigin(size));
+ }
+
windowShim_->SetBounds(windowRect);
// Puts the incognito badge on the window frame, if necessary. Do this
« no previous file with comments | « no previous file | chrome/browser/window_sizer_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698