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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // Enable the buttons if the find text is non-empty. | 305 // Enable the buttons if the find text is non-empty. |
306 BOOL buttonsEnabled = ([[findText_ stringValue] length] > 0) ? YES : NO; | 306 BOOL buttonsEnabled = ([[findText_ stringValue] length] > 0) ? YES : NO; |
307 [previousButton_ setEnabled:buttonsEnabled]; | 307 [previousButton_ setEnabled:buttonsEnabled]; |
308 [nextButton_ setEnabled:buttonsEnabled]; | 308 [nextButton_ setEnabled:buttonsEnabled]; |
309 } | 309 } |
310 | 310 |
311 - (void)restoreSavedFocus { | 311 - (void)restoreSavedFocus { |
312 if (!(focusTracker_.get() && | 312 if (!(focusTracker_.get() && |
313 [focusTracker_ restoreFocusInWindow:[findBarView_ window]])) { | 313 [focusTracker_ restoreFocusInWindow:[findBarView_ window]])) { |
314 // Fall back to giving focus to the tab contents. | 314 // Fall back to giving focus to the tab contents. |
315 findBarBridge_->GetFindBarController()->web_contents()->Focus(); | 315 findBarBridge_->GetFindBarController()->web_contents()->GetView()->Focus(); |
316 } | 316 } |
317 focusTracker_.reset(nil); | 317 focusTracker_.reset(nil); |
318 } | 318 } |
319 | 319 |
320 - (void)setFindText:(NSString*)findText { | 320 - (void)setFindText:(NSString*)findText { |
321 [findText_ setStringValue:findText]; | 321 [findText_ setStringValue:findText]; |
322 | 322 |
323 // Make sure the text in the find bar always ends up in the find pasteboard | 323 // Make sure the text in the find bar always ends up in the find pasteboard |
324 // (and, via notifications, in the other find bars too). | 324 // (and, via notifications, in the other find bars too). |
325 [[FindPasteboard sharedInstance] setFindText:findText]; | 325 [[FindPasteboard sharedInstance] setFindText:findText]; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 } | 547 } |
548 } | 548 } |
549 | 549 |
550 // Has to happen after |ClearResults()| above. | 550 // Has to happen after |ClearResults()| above. |
551 BOOL buttonsEnabled = [text length] > 0 ? YES : NO; | 551 BOOL buttonsEnabled = [text length] > 0 ? YES : NO; |
552 [previousButton_ setEnabled:buttonsEnabled]; | 552 [previousButton_ setEnabled:buttonsEnabled]; |
553 [nextButton_ setEnabled:buttonsEnabled]; | 553 [nextButton_ setEnabled:buttonsEnabled]; |
554 } | 554 } |
555 | 555 |
556 @end | 556 @end |
OLD | NEW |