| OLD | NEW |
| 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 "extension_installed_bubble_controller.h" | 5 #import "extension_installed_bubble_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // Find the center of the bottom of the page action icon. | 193 // Find the center of the bottom of the page action icon. |
| 194 AutocompleteTextField* field = | 194 AutocompleteTextField* field = |
| 195 locationBarView->GetAutocompleteTextField(); | 195 locationBarView->GetAutocompleteTextField(); |
| 196 size_t index = | 196 size_t index = |
| 197 locationBarView->GetPageActionIndex(extension_->page_action()); | 197 locationBarView->GetPageActionIndex(extension_->page_action()); |
| 198 NSView* browserContentWindow = [window->GetNativeHandle() contentView]; | 198 NSView* browserContentWindow = [window->GetNativeHandle() contentView]; |
| 199 NSRect iconRect = [[field autocompleteTextFieldCell] | 199 NSRect iconRect = [[field autocompleteTextFieldCell] |
| 200 pageActionFrameForIndex:index inFrame:[field frame]]; | 200 pageActionFrameForIndex:index inFrame:[field frame]]; |
| 201 NSRect boundsrect = [browserContentWindow convertRect:iconRect | 201 NSRect boundsrect = [browserContentWindow convertRect:iconRect |
| 202 fromView:[field superview]]; | 202 fromView:[field superview]]; |
| 203 arrowPoint = | 203 arrowPoint = NSMakePoint(NSMidX(boundsrect) + 1, NSMinY(boundsrect)); |
| 204 NSMakePoint(NSMinX(boundsrect) - NSWidth(boundsrect) / 2 - 1, | |
| 205 NSMinY(boundsrect)); | |
| 206 break; | 204 break; |
| 207 } | 205 } |
| 208 default: { | 206 default: { |
| 209 NOTREACHED() << "Generic extension type not allowed in install bubble."; | 207 NOTREACHED() << "Generic extension type not allowed in install bubble."; |
| 210 } | 208 } |
| 211 } | 209 } |
| 212 return arrowPoint; | 210 return arrowPoint; |
| 213 } | 211 } |
| 214 | 212 |
| 215 // We want this to be a child of a browser window. addChildWindow: | 213 // We want this to be a child of a browser window. addChildWindow: |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 336 |
| 339 - (NSRect)getPageActionInfoMsgFrame { | 337 - (NSRect)getPageActionInfoMsgFrame { |
| 340 return [pageActionInfoMsg_ frame]; | 338 return [pageActionInfoMsg_ frame]; |
| 341 } | 339 } |
| 342 | 340 |
| 343 - (NSRect)getExtensionInstalledInfoMsgFrame { | 341 - (NSRect)getExtensionInstalledInfoMsgFrame { |
| 344 return [extensionInstalledInfoMsg_ frame]; | 342 return [extensionInstalledInfoMsg_ frame]; |
| 345 } | 343 } |
| 346 | 344 |
| 347 @end | 345 @end |
| OLD | NEW |