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

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

Issue 151283006: Mac OS X: Show the Translate icon on Omnibox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue-307352-translate-bubble-2
Patch Set: groby's review Created 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/cocoa/toolbar/toolbar_controller.h" 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 locationBarView_->Update(tab); 443 locationBarView_->Update(tab);
444 444
445 [locationBar_ updateMouseTracking]; 445 [locationBar_ updateMouseTracking];
446 446
447 if (browserActionsController_.get()) { 447 if (browserActionsController_.get()) {
448 [browserActionsController_ update]; 448 [browserActionsController_ update];
449 } 449 }
450 } 450 }
451 451
452 - (void)setStarredState:(BOOL)isStarred { 452 - (void)setStarredState:(BOOL)isStarred {
453 locationBarView_->SetStarred(isStarred ? true : false); 453 locationBarView_->SetStarred(isStarred);
454 }
455
456 - (void)setTranslateIconLit:(BOOL)on {
457 locationBarView_->SetTranslateIconLit(on);
454 } 458 }
455 459
456 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { 460 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble {
457 locationBarView_->ZoomChangedForActiveTab( 461 locationBarView_->ZoomChangedForActiveTab(
458 canShowBubble && ![wrenchMenuController_ isMenuOpen]); 462 canShowBubble && ![wrenchMenuController_ isMenuOpen]);
459 } 463 }
460 464
461 - (void)setIsLoading:(BOOL)isLoading force:(BOOL)force { 465 - (void)setIsLoading:(BOOL)isLoading force:(BOOL)force {
462 [reloadButton_ setIsLoading:isLoading force:force]; 466 [reloadButton_ setIsLoading:isLoading force:force];
463 } 467 }
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 return locationBarView_->GetBookmarkBubblePoint(); 741 return locationBarView_->GetBookmarkBubblePoint();
738 742
739 // Grab bottom middle of hotdogs. 743 // Grab bottom middle of hotdogs.
740 NSRect frame = wrenchButton_.frame; 744 NSRect frame = wrenchButton_.frame;
741 NSPoint point = NSMakePoint(NSMidX(frame), NSMinY(frame)); 745 NSPoint point = NSMakePoint(NSMidX(frame), NSMinY(frame));
742 // Inset to account for the whitespace around the hotdogs. 746 // Inset to account for the whitespace around the hotdogs.
743 point.y += wrench_menu_controller::kWrenchBubblePointOffsetY; 747 point.y += wrench_menu_controller::kWrenchBubblePointOffsetY;
744 return [self.view convertPoint:point toView:nil]; 748 return [self.view convertPoint:point toView:nil];
745 } 749 }
746 750
751 - (NSPoint)translateBubblePoint {
752 return locationBarView_->GetTranslateBubblePoint();
753 }
754
747 - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight { 755 - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight {
748 // With no toolbar, just ignore the compression. 756 // With no toolbar, just ignore the compression.
749 if (!hasToolbar_) 757 if (!hasToolbar_)
750 return NSHeight([locationBar_ frame]); 758 return NSHeight([locationBar_ frame]);
751 759
752 return kBaseToolbarHeightNormal - compressByHeight; 760 return kBaseToolbarHeightNormal - compressByHeight;
753 } 761 }
754 762
755 - (void)setDividerOpacity:(CGFloat)opacity { 763 - (void)setDividerOpacity:(CGFloat)opacity {
756 BackgroundGradientView* view = [self backgroundGradientView]; 764 BackgroundGradientView* view = [self backgroundGradientView];
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 - (void)hideDropURLsIndicatorInView:(NSView*)view { 836 - (void)hideDropURLsIndicatorInView:(NSView*)view {
829 // Do nothing. 837 // Do nothing.
830 } 838 }
831 839
832 // (URLDropTargetController protocol) 840 // (URLDropTargetController protocol)
833 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { 841 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info {
834 return drag_util::IsUnsupportedDropData(profile_, info); 842 return drag_util::IsUnsupportedDropData(profile_, info);
835 } 843 }
836 844
837 @end 845 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698