| 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 27 matching lines...) Expand all Loading... |
| 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_view_mac.h" | 39 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 40 #import "chrome/browser/ui/cocoa/menu_button.h" | 40 #import "chrome/browser/ui/cocoa/menu_button.h" |
| 41 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button.h" | 41 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button.h" |
| 42 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.h" | 42 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.h" |
| 43 #import "chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.h" | 43 #import "chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.h" |
| 44 #import "chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.h" | 44 #import "chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.h" |
| 45 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h" | 45 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h" |
| 46 #import "chrome/browser/ui/cocoa/toolbar/toolbar_view_cocoa.h" | 46 #import "chrome/browser/ui/cocoa/toolbar/toolbar_view_cocoa.h" |
| 47 #import "chrome/browser/ui/cocoa/view_id_util.h" | 47 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| 48 #include "chrome/browser/ui/layout_constants.h" |
| 48 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 49 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 49 #include "chrome/browser/ui/toolbar/app_menu_badge_controller.h" | 50 #include "chrome/browser/ui/toolbar/app_menu_badge_controller.h" |
| 50 #include "chrome/browser/ui/toolbar/app_menu_model.h" | 51 #include "chrome/browser/ui/toolbar/app_menu_model.h" |
| 51 #include "chrome/common/pref_names.h" | 52 #include "chrome/common/pref_names.h" |
| 52 #include "chrome/grit/chromium_strings.h" | 53 #include "chrome/grit/chromium_strings.h" |
| 53 #include "chrome/grit/generated_resources.h" | 54 #include "chrome/grit/generated_resources.h" |
| 54 #include "components/metrics/proto/omnibox_event.pb.h" | 55 #include "components/metrics/proto/omnibox_event.pb.h" |
| 55 #include "components/omnibox/browser/autocomplete_classifier.h" | 56 #include "components/omnibox/browser/autocomplete_classifier.h" |
| 56 #include "components/omnibox/browser/autocomplete_match.h" | 57 #include "components/omnibox/browser/autocomplete_match.h" |
| 57 #include "components/omnibox/browser/omnibox_view.h" | 58 #include "components/omnibox/browser/omnibox_view.h" |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 if ([browserActionsContainerView_ isHidden]) { | 876 if ([browserActionsContainerView_ isHidden]) { |
| 876 CGFloat edgeXPos = [appMenuButton_ frame].origin.x; | 877 CGFloat edgeXPos = [appMenuButton_ frame].origin.x; |
| 877 leftDistance = edgeXPos - locationBarXPos - | 878 leftDistance = edgeXPos - locationBarXPos - |
| 878 [ToolbarController appMenuLeftPadding]; | 879 [ToolbarController appMenuLeftPadding]; |
| 879 } else { | 880 } else { |
| 880 leftDistance = NSMinX([browserActionsContainerView_ animationEndFrame]) - | 881 leftDistance = NSMinX([browserActionsContainerView_ animationEndFrame]) - |
| 881 locationBarXPos; | 882 locationBarXPos; |
| 882 // Equalize the distance between the location bar and the first extension | 883 // Equalize the distance between the location bar and the first extension |
| 883 // button, and the distance between the location bar and home/reload button. | 884 // button, and the distance between the location bar and home/reload button. |
| 884 if (ui::MaterialDesignController::IsModeMaterial()) { | 885 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 885 leftDistance -= 4; | 886 leftDistance += GetLayoutConstant(TOOLBAR_ACTIONS_LEFT_PADDING); |
| 886 } | 887 } |
| 887 } | 888 } |
| 888 if (leftDistance != 0.0) | 889 if (leftDistance != 0.0) |
| 889 [self adjustLocationSizeBy:leftDistance animate:animate]; | 890 [self adjustLocationSizeBy:leftDistance animate:animate]; |
| 890 else | 891 else |
| 891 [locationBar_ stopAnimation]; | 892 [locationBar_ stopAnimation]; |
| 892 } | 893 } |
| 893 | 894 |
| 894 - (void)maintainMinimumLocationBarWidth { | 895 - (void)maintainMinimumLocationBarWidth { |
| 895 CGFloat locationBarWidth = NSWidth([locationBar_ frame]); | 896 CGFloat locationBarWidth = NSWidth([locationBar_ frame]); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 1125 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 1125 // Do nothing. | 1126 // Do nothing. |
| 1126 } | 1127 } |
| 1127 | 1128 |
| 1128 // (URLDropTargetController protocol) | 1129 // (URLDropTargetController protocol) |
| 1129 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 1130 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 1130 return drag_util::IsUnsupportedDropData(profile_, info); | 1131 return drag_util::IsUnsupportedDropData(profile_, info); |
| 1131 } | 1132 } |
| 1132 | 1133 |
| 1133 @end | 1134 @end |
| OLD | NEW |