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

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

Issue 178007: [Mac] Tweaks to Omnibox metrics. (Closed)
Patch Set: Oops, fixed unit test. Created 11 years, 3 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/toolbar_controller.h" 5 #import "chrome/browser/cocoa/toolbar_controller.h"
6 6
7 #include "base/mac_util.h" 7 #include "base/mac_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "chrome/app/chrome_dll_resource.h" 10 #include "chrome/app/chrome_dll_resource.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 405
406 - (gfx::Rect)autocompletePopupPosition { 406 - (gfx::Rect)autocompletePopupPosition {
407 // The popup should span from the left edge of the star button to the right 407 // The popup should span from the left edge of the star button to the right
408 // edge of the go button. The returned height is ignored. 408 // edge of the go button. The returned height is ignored.
409 NSRect locationFrame = [locationBar_ frame]; 409 NSRect locationFrame = [locationBar_ frame];
410 int minX = NSMinX([starButton_ frame]); 410 int minX = NSMinX([starButton_ frame]);
411 int maxX = NSMaxX([goButton_ frame]); 411 int maxX = NSMaxX([goButton_ frame]);
412 DCHECK(minX < NSMinX(locationFrame)); 412 DCHECK(minX < NSMinX(locationFrame));
413 DCHECK(maxX > NSMaxX(locationFrame)); 413 DCHECK(maxX > NSMaxX(locationFrame));
414 414
415 NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX, 0); 415 // TODO(shess): The + 1.0 is because the field's visual boundary
416 // differs from its on-screen boundary.
417 NSRect r = NSMakeRect(minX, NSMinY(locationFrame) + 1.0, maxX - minX, 0);
416 return gfx::Rect(NSRectToCGRect([[self view] convertRect:r toView:nil])); 418 return gfx::Rect(NSRectToCGRect([[self view] convertRect:r toView:nil]));
417 } 419 }
418 @end 420 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_cell.mm ('k') | chrome/browser/cocoa/toolbar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698