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

Side by Side Diff: chrome/browser/cocoa/location_bar/location_bar_view_mac.mm

Issue 3461016: [Mac] Convert the page info window to a bubble. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Address nits Created 10 years, 2 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 "chrome/browser/cocoa/location_bar/location_bar_view_mac.h" 5 #import "chrome/browser/cocoa/location_bar/location_bar_view_mac.h"
6 6
7 #include "app/l10n_util_mac.h" 7 #include "app/l10n_util_mac.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/nsimage_cache_mac.h" 9 #include "base/nsimage_cache_mac.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 } 402 }
403 403
404 NSPoint LocationBarViewMac::GetBookmarkBubblePoint() const { 404 NSPoint LocationBarViewMac::GetBookmarkBubblePoint() const {
405 AutocompleteTextFieldCell* cell = [field_ cell]; 405 AutocompleteTextFieldCell* cell = [field_ cell];
406 const NSRect frame = [cell frameForDecoration:star_decoration_.get() 406 const NSRect frame = [cell frameForDecoration:star_decoration_.get()
407 inFrame:[field_ bounds]]; 407 inFrame:[field_ bounds]];
408 const NSPoint point = star_decoration_->GetBubblePointInFrame(frame); 408 const NSPoint point = star_decoration_->GetBubblePointInFrame(frame);
409 return [field_ convertPoint:point toView:nil]; 409 return [field_ convertPoint:point toView:nil];
410 } 410 }
411 411
412 NSPoint LocationBarViewMac::GetPageInfoBubblePoint() const {
413 AutocompleteTextFieldCell* cell = [field_ cell];
414 const NSRect frame = [cell frameForDecoration:location_icon_decoration_.get()
415 inFrame:[field_ bounds]];
416 const NSPoint point = location_icon_decoration_->GetBubblePointInFrame(frame);
417 return [field_ convertPoint:point toView:nil];
418 }
419
412 NSImage* LocationBarViewMac::GetKeywordImage(const std::wstring& keyword) { 420 NSImage* LocationBarViewMac::GetKeywordImage(const std::wstring& keyword) {
413 const TemplateURL* template_url = 421 const TemplateURL* template_url =
414 profile_->GetTemplateURLModel()->GetTemplateURLForKeyword(keyword); 422 profile_->GetTemplateURLModel()->GetTemplateURLForKeyword(keyword);
415 if (template_url && template_url->IsExtensionKeyword()) { 423 if (template_url && template_url->IsExtensionKeyword()) {
416 const SkBitmap& bitmap = profile_->GetExtensionsService()-> 424 const SkBitmap& bitmap = profile_->GetExtensionsService()->
417 GetOmniboxIcon(template_url->GetExtensionId()); 425 GetOmniboxIcon(template_url->GetExtensionId());
418 return gfx::SkBitmapToNSImage(bitmap); 426 return gfx::SkBitmapToNSImage(bitmap);
419 } 427 }
420 428
421 return AutocompleteEditViewMac::ImageForResource(IDR_OMNIBOX_SEARCH); 429 return AutocompleteEditViewMac::ImageForResource(IDR_OMNIBOX_SEARCH);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 577
570 // These need to change anytime the layout changes. 578 // These need to change anytime the layout changes.
571 // TODO(shess): Anytime the field editor might have changed, the 579 // TODO(shess): Anytime the field editor might have changed, the
572 // cursor rects almost certainly should have changed. The tooltips 580 // cursor rects almost certainly should have changed. The tooltips
573 // might change even when the rects don't change. 581 // might change even when the rects don't change.
574 [field_ resetFieldEditorFrameIfNeeded]; 582 [field_ resetFieldEditorFrameIfNeeded];
575 [field_ updateCursorAndToolTipRects]; 583 [field_ updateCursorAndToolTipRects];
576 584
577 [field_ setNeedsDisplay:YES]; 585 [field_ setNeedsDisplay:YES];
578 } 586 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698