| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |