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

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: Use kAnimateNone Created 6 years, 9 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 locationBarView_->Update(tab); 444 locationBarView_->Update(tab);
445 445
446 [locationBar_ updateMouseTracking]; 446 [locationBar_ updateMouseTracking];
447 447
448 if (browserActionsController_.get()) { 448 if (browserActionsController_.get()) {
449 [browserActionsController_ update]; 449 [browserActionsController_ update];
450 } 450 }
451 } 451 }
452 452
453 - (void)setStarredState:(BOOL)isStarred { 453 - (void)setStarredState:(BOOL)isStarred {
454 locationBarView_->SetStarred(isStarred ? true : false); 454 locationBarView_->SetStarred(isStarred);
455 }
456
457 - (void)setTranslateIconLit:(BOOL)on {
458 locationBarView_->SetTranslateIconLit(on);
455 } 459 }
456 460
457 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { 461 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble {
458 locationBarView_->ZoomChangedForActiveTab( 462 locationBarView_->ZoomChangedForActiveTab(
459 canShowBubble && ![wrenchMenuController_ isMenuOpen]); 463 canShowBubble && ![wrenchMenuController_ isMenuOpen]);
460 } 464 }
461 465
462 - (void)setIsLoading:(BOOL)isLoading force:(BOOL)force { 466 - (void)setIsLoading:(BOOL)isLoading force:(BOOL)force {
463 [reloadButton_ setIsLoading:isLoading force:force]; 467 [reloadButton_ setIsLoading:isLoading force:force];
464 } 468 }
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 return locationBarView_->GetBookmarkBubblePoint(); 742 return locationBarView_->GetBookmarkBubblePoint();
739 743
740 // Grab bottom middle of hotdogs. 744 // Grab bottom middle of hotdogs.
741 NSRect frame = wrenchButton_.frame; 745 NSRect frame = wrenchButton_.frame;
742 NSPoint point = NSMakePoint(NSMidX(frame), NSMinY(frame)); 746 NSPoint point = NSMakePoint(NSMidX(frame), NSMinY(frame));
743 // Inset to account for the whitespace around the hotdogs. 747 // Inset to account for the whitespace around the hotdogs.
744 point.y += wrench_menu_controller::kWrenchBubblePointOffsetY; 748 point.y += wrench_menu_controller::kWrenchBubblePointOffsetY;
745 return [self.view convertPoint:point toView:nil]; 749 return [self.view convertPoint:point toView:nil];
746 } 750 }
747 751
752 - (NSPoint)translateBubblePoint {
753 return locationBarView_->GetTranslateBubblePoint();
754 }
755
748 - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight { 756 - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight {
749 // With no toolbar, just ignore the compression. 757 // With no toolbar, just ignore the compression.
750 if (!hasToolbar_) 758 if (!hasToolbar_)
751 return NSHeight([locationBar_ frame]); 759 return NSHeight([locationBar_ frame]);
752 760
753 return kBaseToolbarHeightNormal - compressByHeight; 761 return kBaseToolbarHeightNormal - compressByHeight;
754 } 762 }
755 763
756 - (void)setDividerOpacity:(CGFloat)opacity { 764 - (void)setDividerOpacity:(CGFloat)opacity {
757 BackgroundGradientView* view = [self backgroundGradientView]; 765 BackgroundGradientView* view = [self backgroundGradientView];
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 - (void)hideDropURLsIndicatorInView:(NSView*)view { 846 - (void)hideDropURLsIndicatorInView:(NSView*)view {
839 // Do nothing. 847 // Do nothing.
840 } 848 }
841 849
842 // (URLDropTargetController protocol) 850 // (URLDropTargetController protocol)
843 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { 851 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info {
844 return drag_util::IsUnsupportedDropData(profile_, info); 852 return drag_util::IsUnsupportedDropData(profile_, info);
845 } 853 }
846 854
847 @end 855 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_controller.h ('k') | chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698