| OLD | NEW |
| 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/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/ui/browser_window.h" | 29 #include "chrome/browser/ui/browser_window.h" |
| 30 #import "chrome/browser/ui/cocoa/app_menu/app_menu_controller.h" | 30 #import "chrome/browser/ui/cocoa/app_menu/app_menu_controller.h" |
| 31 #import "chrome/browser/ui/cocoa/background_gradient_view.h" | 31 #import "chrome/browser/ui/cocoa/background_gradient_view.h" |
| 32 #include "chrome/browser/ui/cocoa/drag_util.h" | 32 #include "chrome/browser/ui/cocoa/drag_util.h" |
| 33 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" | 33 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" |
| 34 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" | 34 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" |
| 35 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" | 35 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" |
| 36 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" | 36 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" |
| 37 #import "chrome/browser/ui/cocoa/image_button_cell.h" | 37 #import "chrome/browser/ui/cocoa/image_button_cell.h" |
| 38 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" | 38 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" |
| 39 #import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" |
| 39 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 40 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 41 #import "chrome/browser/ui/cocoa/location_bar/star_decoration.h" |
| 40 #import "chrome/browser/ui/cocoa/menu_button.h" | 42 #import "chrome/browser/ui/cocoa/menu_button.h" |
| 41 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button.h" | 43 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button.h" |
| 42 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.h" | 44 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.h" |
| 43 #import "chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.h" | 45 #import "chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.h" |
| 44 #import "chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.h" | 46 #import "chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.h" |
| 45 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h" | 47 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h" |
| 46 #import "chrome/browser/ui/cocoa/toolbar/toolbar_view_cocoa.h" | 48 #import "chrome/browser/ui/cocoa/toolbar/toolbar_view_cocoa.h" |
| 47 #import "chrome/browser/ui/cocoa/view_id_util.h" | 49 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| 48 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 50 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 49 #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" | 51 #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 [locationBar_ stopAnimation]; | 953 [locationBar_ stopAnimation]; |
| 952 | 954 |
| 953 if (animate) | 955 if (animate) |
| 954 [locationBar_ animateToFrame:locationFrame]; | 956 [locationBar_ animateToFrame:locationFrame]; |
| 955 else | 957 else |
| 956 [locationBar_ setFrame:locationFrame]; | 958 [locationBar_ setFrame:locationFrame]; |
| 957 } | 959 } |
| 958 | 960 |
| 959 - (NSPoint)bookmarkBubblePoint { | 961 - (NSPoint)bookmarkBubblePoint { |
| 960 if (locationBarView_->IsStarEnabled()) | 962 if (locationBarView_->IsStarEnabled()) |
| 961 return locationBarView_->GetBookmarkBubblePoint(); | 963 return locationBarView_->GetBubblePointForDecoration( |
| 964 locationBarView_->star_decoration()); |
| 962 | 965 |
| 963 // Grab bottom middle of hotdogs. | 966 // Grab bottom middle of hotdogs. |
| 964 NSRect frame = appMenuButton_.frame; | 967 NSRect frame = appMenuButton_.frame; |
| 965 NSPoint point = NSMakePoint(NSMidX(frame), NSMinY(frame)); | 968 NSPoint point = NSMakePoint(NSMidX(frame), NSMinY(frame)); |
| 966 // Inset to account for the whitespace around the hotdogs. | 969 // Inset to account for the whitespace around the hotdogs. |
| 967 point.y += app_menu_controller::kAppMenuBubblePointOffsetY; | 970 point.y += app_menu_controller::kAppMenuBubblePointOffsetY; |
| 968 return [self.view convertPoint:point toView:nil]; | 971 return [self.view convertPoint:point toView:nil]; |
| 969 } | 972 } |
| 970 | 973 |
| 971 - (NSPoint)managePasswordsBubblePoint { | |
| 972 return locationBarView_->GetManagePasswordsBubblePoint(); | |
| 973 } | |
| 974 | |
| 975 - (NSPoint)saveCreditCardBubblePoint { | 974 - (NSPoint)saveCreditCardBubblePoint { |
| 976 return locationBarView_->GetSaveCreditCardBubblePoint(); | 975 return locationBarView_->GetSaveCreditCardBubblePoint(); |
| 977 } | 976 } |
| 978 | 977 |
| 979 - (NSPoint)translateBubblePoint { | |
| 980 return locationBarView_->GetTranslateBubblePoint(); | |
| 981 } | |
| 982 | |
| 983 - (CGFloat)baseToolbarHeight { | 978 - (CGFloat)baseToolbarHeight { |
| 984 // Height of the toolbar in pixels when the bookmark bar is closed. | 979 // Height of the toolbar in pixels when the bookmark bar is closed. |
| 985 const CGFloat kBaseToolbarHeightNormal = 37; | 980 const CGFloat kBaseToolbarHeightNormal = 37; |
| 986 return kBaseToolbarHeightNormal; | 981 return kBaseToolbarHeightNormal; |
| 987 } | 982 } |
| 988 | 983 |
| 989 - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight { | 984 - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight { |
| 990 // With no toolbar, just ignore the compression. | 985 // With no toolbar, just ignore the compression. |
| 991 if (!hasToolbar_) | 986 if (!hasToolbar_) |
| 992 return NSHeight([locationBar_ frame]); | 987 return NSHeight([locationBar_ frame]); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 1074 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 1080 // Do nothing. | 1075 // Do nothing. |
| 1081 } | 1076 } |
| 1082 | 1077 |
| 1083 // (URLDropTargetController protocol) | 1078 // (URLDropTargetController protocol) |
| 1084 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 1079 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 1085 return drag_util::IsUnsupportedDropData(profile_, info); | 1080 return drag_util::IsUnsupportedDropData(profile_, info); |
| 1086 } | 1081 } |
| 1087 | 1082 |
| 1088 @end | 1083 @end |
| OLD | NEW |