| 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 <sys/stat.h> | 7 #include <sys/stat.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/debug/crash_logging.h" | 10 #include "base/debug/crash_logging.h" |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 - (LocationBarViewMac*)locationBarBridge { | 591 - (LocationBarViewMac*)locationBarBridge { |
| 592 return locationBarView_.get(); | 592 return locationBarView_.get(); |
| 593 } | 593 } |
| 594 | 594 |
| 595 - (void)locationBarWasAddedToWindow { | 595 - (void)locationBarWasAddedToWindow { |
| 596 // Allow the |locationBarView_| to update itself to match the browser window | 596 // Allow the |locationBarView_| to update itself to match the browser window |
| 597 // theme. | 597 // theme. |
| 598 locationBarView_->OnAddedToWindow(); | 598 locationBarView_->OnAddedToWindow(); |
| 599 } | 599 } |
| 600 | 600 |
| 601 - (BOOL)locationBarHasFocus { |
| 602 return [autocompleteTextFieldEditor_ window] != nil; |
| 603 } |
| 604 |
| 601 - (void)focusLocationBar:(BOOL)selectAll { | 605 - (void)focusLocationBar:(BOOL)selectAll { |
| 602 if (locationBarView_.get()) { | 606 if (locationBarView_.get()) { |
| 603 locationBarView_->FocusLocation(selectAll ? true : false); | 607 locationBarView_->FocusLocation(selectAll ? true : false); |
| 604 } | 608 } |
| 605 } | 609 } |
| 606 | 610 |
| 607 // Called when the state for a command changes to |enabled|. Update the | 611 // Called when the state for a command changes to |enabled|. Update the |
| 608 // corresponding UI element. | 612 // corresponding UI element. |
| 609 - (void)enabledStateChangedForCommand:(int)command enabled:(bool)enabled { | 613 - (void)enabledStateChangedForCommand:(int)command enabled:(bool)enabled { |
| 610 NSButton* button = nil; | 614 NSButton* button = nil; |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 1113 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 1110 // Do nothing. | 1114 // Do nothing. |
| 1111 } | 1115 } |
| 1112 | 1116 |
| 1113 // (URLDropTargetController protocol) | 1117 // (URLDropTargetController protocol) |
| 1114 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 1118 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 1115 return drag_util::IsUnsupportedDropData(profile_, info); | 1119 return drag_util::IsUnsupportedDropData(profile_, info); |
| 1116 } | 1120 } |
| 1117 | 1121 |
| 1118 @end | 1122 @end |
| OLD | NEW |