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

Unified Diff: remoting/host/disconnect_window_mac.mm

Issue 8623006: Center the disconnect window at the bottom of the screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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: remoting/host/disconnect_window_mac.mm
diff --git a/remoting/host/disconnect_window_mac.mm b/remoting/host/disconnect_window_mac.mm
index 94ba85508b8779610f00504a3d59058441ed57f2..8c48f10e77391fd288791357e689cb9441807109 100644
--- a/remoting/host/disconnect_window_mac.mm
+++ b/remoting/host/disconnect_window_mac.mm
@@ -155,6 +155,13 @@ remoting::DisconnectWindow* remoting::DisconnectWindow::Create() {
[connectedToField_ setFrame:connectedToFrame];
[disconnectButton_ setFrame:disconnectFrame];
}
+
+ // Center the window at the bottom of the screen, above the dock (if present).
+ NSRect desktop_rect = [[NSScreen mainScreen] visibleFrame];
+ NSRect window_rect = [[self window] frame];
+ int x = (desktop_rect.size.width - window_rect.size.width) / 2;
dmac 2011/11/22 05:42:06 Please use objective C naming in objective c files
+ int y = desktop_rect.origin.y;
+ [[self window] setFrameOrigin:NSMakePoint(x, y)];
}
- (void)windowWillClose:(NSNotification*)notification {
« 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