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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm

Issue 10540173: HiDPI: Fix extension bubble size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/cocoa/extensions/extension_popup_controller.h" 5 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/debugger/devtools_window.h" 9 #include "chrome/browser/debugger/devtools_window.h"
10 #include "chrome/browser/extensions/extension_host.h" 10 #include "chrome/browser/extensions/extension_host.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 // Pad the window by half of the rounded corner radius to prevent the 282 // Pad the window by half of the rounded corner radius to prevent the
283 // extension's view from bleeding out over the corners. 283 // extension's view from bleeding out over the corners.
284 CGFloat inset = info_bubble::kBubbleCornerRadius / 2.0; 284 CGFloat inset = info_bubble::kBubbleCornerRadius / 2.0;
285 [extensionView_ setFrameOrigin:NSMakePoint(inset, inset)]; 285 [extensionView_ setFrameOrigin:NSMakePoint(inset, inset)];
286 286
287 NSRect frame = [extensionView_ frame]; 287 NSRect frame = [extensionView_ frame];
288 frame.size.height += info_bubble::kBubbleArrowHeight + 288 frame.size.height += info_bubble::kBubbleArrowHeight +
289 info_bubble::kBubbleCornerRadius; 289 info_bubble::kBubbleCornerRadius;
290 frame.size.width += info_bubble::kBubbleCornerRadius; 290 frame.size.width += info_bubble::kBubbleCornerRadius;
291 frame = [extensionView_ convertRectToBase:frame]; 291 frame = [extensionView_ convertRect:frame toView:nil];
292 // Adjust the origin according to the height and width so that the arrow is 292 // Adjust the origin according to the height and width so that the arrow is
293 // positioned correctly at the middle and slightly down from the button. 293 // positioned correctly at the middle and slightly down from the button.
294 NSPoint windowOrigin = self.anchorPoint; 294 NSPoint windowOrigin = self.anchorPoint;
295 NSSize offsets = NSMakeSize(info_bubble::kBubbleArrowXOffset + 295 NSSize offsets = NSMakeSize(info_bubble::kBubbleArrowXOffset +
296 info_bubble::kBubbleArrowWidth / 2.0, 296 info_bubble::kBubbleArrowWidth / 2.0,
297 info_bubble::kBubbleArrowHeight / 2.0); 297 info_bubble::kBubbleArrowHeight / 2.0);
298 offsets = [extensionView_ convertSize:offsets toView:nil]; 298 offsets = [extensionView_ convertSize:offsets toView:nil];
299 windowOrigin.x -= NSWidth(frame) - offsets.width; 299 windowOrigin.x -= NSWidth(frame) - offsets.width;
300 windowOrigin.y -= NSHeight(frame) - offsets.height; 300 windowOrigin.y -= NSHeight(frame) - offsets.height;
301 frame.origin = windowOrigin; 301 frame.origin = windowOrigin;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 return minSize; 369 return minSize;
370 } 370 }
371 371
372 // Private (TestingAPI) 372 // Private (TestingAPI)
373 + (NSSize)maxPopupSize { 373 + (NSSize)maxPopupSize {
374 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; 374 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight};
375 return maxSize; 375 return maxSize;
376 } 376 }
377 377
378 @end 378 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698