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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 // same thread, so there shoudn't be a race condition here. | 715 // same thread, so there shoudn't be a race condition here. |
716 if (autocompleteTextFieldEditor_.get() == nil) { | 716 if (autocompleteTextFieldEditor_.get() == nil) { |
717 autocompleteTextFieldEditor_.reset( | 717 autocompleteTextFieldEditor_.reset( |
718 [[AutocompleteTextFieldEditor alloc] init]); | 718 [[AutocompleteTextFieldEditor alloc] init]); |
719 } | 719 } |
720 | 720 |
721 // This needs to be called every time, otherwise notifications | 721 // This needs to be called every time, otherwise notifications |
722 // aren't sent correctly. | 722 // aren't sent correctly. |
723 DCHECK(autocompleteTextFieldEditor_.get()); | 723 DCHECK(autocompleteTextFieldEditor_.get()); |
724 [autocompleteTextFieldEditor_.get() setFieldEditor:YES]; | 724 [autocompleteTextFieldEditor_.get() setFieldEditor:YES]; |
725 if (base::mac::IsOSSnowLeopard()) { | |
726 // Manually transferring the drawsBackground and backgroundColor | |
727 // properties is necessary to ensure anti-aliased text on 10.6. | |
728 [autocompleteTextFieldEditor_ | |
729 setDrawsBackground:[locationBar_ drawsBackground]]; | |
730 [autocompleteTextFieldEditor_ | |
731 setBackgroundColor:[locationBar_ backgroundColor]]; | |
732 } | |
733 return autocompleteTextFieldEditor_.get(); | 725 return autocompleteTextFieldEditor_.get(); |
734 } | 726 } |
735 return nil; | 727 return nil; |
736 } | 728 } |
737 | 729 |
738 // Returns an array of views in the order of the outlets above. | 730 // Returns an array of views in the order of the outlets above. |
739 - (NSArray*)toolbarViews { | 731 - (NSArray*)toolbarViews { |
740 return [NSArray arrayWithObjects:backButton_, forwardButton_, reloadButton_, | 732 return [NSArray arrayWithObjects:backButton_, forwardButton_, reloadButton_, |
741 homeButton_, appMenuButton_, locationBar_, | 733 homeButton_, appMenuButton_, locationBar_, |
742 browserActionsContainerView_, nil]; | 734 browserActionsContainerView_, nil]; |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 1122 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
1131 // Do nothing. | 1123 // Do nothing. |
1132 } | 1124 } |
1133 | 1125 |
1134 // (URLDropTargetController protocol) | 1126 // (URLDropTargetController protocol) |
1135 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 1127 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
1136 return drag_util::IsUnsupportedDropData(profile_, info); | 1128 return drag_util::IsUnsupportedDropData(profile_, info); |
1137 } | 1129 } |
1138 | 1130 |
1139 @end | 1131 @end |
OLD | NEW |