| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // reason is not guaranteed to be called (http://crbug.com/526276), so implement | 290 // reason is not guaranteed to be called (http://crbug.com/526276), so implement |
| 291 // both. | 291 // both. |
| 292 - (void)awakeFromNib { | 292 - (void)awakeFromNib { |
| 293 [self viewDidLoad]; | 293 [self viewDidLoad]; |
| 294 } | 294 } |
| 295 | 295 |
| 296 - (void)viewDidLoad { | 296 - (void)viewDidLoad { |
| 297 // When linking and running on 10.10+, both -awakeFromNib and -viewDidLoad may | 297 // When linking and running on 10.10+, both -awakeFromNib and -viewDidLoad may |
| 298 // be called, don't initialize twice. | 298 // be called, don't initialize twice. |
| 299 if (locationBarView_) { | 299 if (locationBarView_) { |
| 300 DCHECK(base::mac::IsOSYosemiteOrLater()); | 300 DCHECK(base::mac::IsAtLeastOS10_10()); |
| 301 return; | 301 return; |
| 302 } | 302 } |
| 303 | 303 |
| 304 // Make Material Design layout adjustments to the NIB items. | 304 // Make Material Design layout adjustments to the NIB items. |
| 305 bool isModeMaterial = ui::MaterialDesignController::IsModeMaterial(); | 305 bool isModeMaterial = ui::MaterialDesignController::IsModeMaterial(); |
| 306 if (isModeMaterial) { | 306 if (isModeMaterial) { |
| 307 ToolbarView* toolbarView = [self toolbarView]; | 307 ToolbarView* toolbarView = [self toolbarView]; |
| 308 NSRect toolbarBounds = [toolbarView bounds]; | 308 NSRect toolbarBounds = [toolbarView bounds]; |
| 309 NSSize toolbarButtonSize = [ToolbarButton toolbarButtonSize]; | 309 NSSize toolbarButtonSize = [ToolbarButton toolbarButtonSize]; |
| 310 | 310 |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 1186 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 1187 // Do nothing. | 1187 // Do nothing. |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 // (URLDropTargetController protocol) | 1190 // (URLDropTargetController protocol) |
| 1191 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 1191 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 1192 return drag_util::IsUnsupportedDropData(profile_, info); | 1192 return drag_util::IsUnsupportedDropData(profile_, info); |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 @end | 1195 @end |
| OLD | NEW |