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

Side by Side Diff: chrome/browser/cocoa/base_bubble_controller.mm

Issue 4544004: Fix bubble offset issue (bubble x-coordinate pointing to wrong place) on OS X... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/cocoa/location_bar/location_bar_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/cocoa/base_bubble_controller.h" 5 #import "chrome/browser/cocoa/base_bubble_controller.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac_util.h" 9 #include "base/mac_util.h"
10 #include "base/scoped_nsobject.h" 10 #include "base/scoped_nsobject.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 184
185 // Takes the |anchor_| point and adjusts the window's origin accordingly. 185 // Takes the |anchor_| point and adjusts the window's origin accordingly.
186 - (void)updateOriginFromAnchor { 186 - (void)updateOriginFromAnchor {
187 NSWindow* window = [self window]; 187 NSWindow* window = [self window];
188 NSPoint origin = anchor_; 188 NSPoint origin = anchor_;
189 NSSize offsets = NSMakeSize(info_bubble::kBubbleArrowXOffset + 189 NSSize offsets = NSMakeSize(info_bubble::kBubbleArrowXOffset +
190 info_bubble::kBubbleArrowWidth / 2.0, 0); 190 info_bubble::kBubbleArrowWidth / 2.0, 0);
191 offsets = [[parentWindow_ contentView] convertSize:offsets toView:nil]; 191 offsets = [[parentWindow_ contentView] convertSize:offsets toView:nil];
192 if ([bubble_ arrowLocation] == info_bubble::kTopRight) { 192 if ([bubble_ arrowLocation] == info_bubble::kTopRight) {
193 origin.x -= NSWidth([window frame]) + offsets.width; 193 origin.x -= NSWidth([window frame]) - offsets.width;
194 } else { 194 } else {
195 origin.x -= offsets.width; 195 origin.x -= offsets.width;
196 } 196 }
197 origin.y -= NSHeight([window frame]); 197 origin.y -= NSHeight([window frame]);
198 [window setFrameOrigin:origin]; 198 [window setFrameOrigin:origin];
199 } 199 }
200 200
201 @end // BaseBubbleController 201 @end // BaseBubbleController
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/location_bar/location_bar_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698