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

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

Issue 600133: Mac: Content blocked icons. (Closed)
Patch Set: comments andybons Created 10 years, 10 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) 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_unittest.mm ('k') | chrome/browser/cocoa/location_bar_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698