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

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

Issue 846006: Merge 41419 - Fix mac unit tests... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/342/src/
Patch Set: Created 10 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_bar_folder_controller.mm
===================================================================
--- chrome/browser/cocoa/bookmark_bar_folder_controller.mm (revision 41472)
+++ chrome/browser/cocoa/bookmark_bar_folder_controller.mm (working copy)
@@ -261,12 +261,14 @@
// Make the window fit on screen, with a distance of at least |padding| from
// the sides.
- const CGFloat padding = 8;
- NSRect screenFrame = [[[self window] screen] frame];
- if (NSMaxX(windowFrame) + padding > NSMaxX(screenFrame))
- windowFrame.origin.x -= NSMaxX(windowFrame) + padding - NSMaxX(screenFrame);
- else if (NSMinX(windowFrame) - padding < NSMinX(screenFrame))
- windowFrame.origin.x += NSMinX(screenFrame) - NSMinX(windowFrame) + padding;
+ if ([[self window] screen]) { // nil in unit tests
+ const CGFloat padding = 8;
+ NSRect screen = [[[self window] screen] frame];
+ if (NSMaxX(windowFrame) + padding > NSMaxX(screen))
+ windowFrame.origin.x -= NSMaxX(windowFrame) + padding - NSMaxX(screen);
+ else if (NSMinX(windowFrame) - padding < NSMinX(screen))
+ windowFrame.origin.x += NSMinX(screen) - NSMinX(windowFrame) + padding;
+ }
[[self window] setFrame:windowFrame display:YES];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698