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/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 - (void)mouseEntered:(NSEvent*)event { | 392 - (void)mouseEntered:(NSEvent*)event { |
393 [self mouseMoved:event]; | 393 [self mouseMoved:event]; |
394 } | 394 } |
395 | 395 |
396 - (LocationBarViewMac*)locationBarBridge { | 396 - (LocationBarViewMac*)locationBarBridge { |
397 return locationBarView_.get(); | 397 return locationBarView_.get(); |
398 } | 398 } |
399 | 399 |
400 - (void)focusLocationBar:(BOOL)selectAll { | 400 - (void)focusLocationBar:(BOOL)selectAll { |
401 if (locationBarView_.get()) { | 401 if (locationBarView_.get()) { |
402 if (chrome::ShouldDisplayOriginChip() && selectAll) { | 402 if (selectAll && |
| 403 locationBarView_->GetToolbarModel()->WouldOmitURLDueToOriginChip()) { |
403 // select_all is true when it's expected that the user may want to copy | 404 // select_all is true when it's expected that the user may want to copy |
404 // the URL to the clipboard. If the origin chip is being displayed (and | 405 // the URL to the clipboard. If the origin chip is being displayed (and |
405 // thus the URL is not being shown in the Omnibox) show it now to support | 406 // thus the URL is not being shown in the Omnibox) show it now to support |
406 // the same functionality. | 407 // the same functionality. |
407 locationBarView_->GetOmniboxView()->ShowURL(); | 408 locationBarView_->GetOmniboxView()->ShowURL(); |
408 } else { | 409 } else { |
409 locationBarView_->FocusLocation(selectAll ? true : false); | 410 locationBarView_->FocusLocation(selectAll ? true : false); |
410 } | 411 } |
411 } | 412 } |
412 } | 413 } |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 829 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
829 // Do nothing. | 830 // Do nothing. |
830 } | 831 } |
831 | 832 |
832 // (URLDropTargetController protocol) | 833 // (URLDropTargetController protocol) |
833 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 834 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
834 return drag_util::IsUnsupportedDropData(profile_, info); | 835 return drag_util::IsUnsupportedDropData(profile_, info); |
835 } | 836 } |
836 | 837 |
837 @end | 838 @end |
OLD | NEW |