| 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/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 if ([searchString length] > 0 && validRange) { | 449 if ([searchString length] > 0 && validRange) { |
| 450 [[findText_ findBarTextFieldCell] | 450 [[findText_ findBarTextFieldCell] |
| 451 setActiveMatch:result.active_match_ordinal() | 451 setActiveMatch:result.active_match_ordinal() |
| 452 of:result.number_of_matches()]; | 452 of:result.number_of_matches()]; |
| 453 } else { | 453 } else { |
| 454 // If there was no text entered, we don't show anything in the results area. | 454 // If there was no text entered, we don't show anything in the results area. |
| 455 [[findText_ findBarTextFieldCell] clearResults]; | 455 [[findText_ findBarTextFieldCell] clearResults]; |
| 456 } | 456 } |
| 457 | 457 |
| 458 [findText_ resetFieldEditorFrameIfNeeded]; | 458 [findText_ resetFieldEditorFrameIfNeeded]; |
| 459 [findText_ setNeedsDisplay:YES]; |
| 459 | 460 |
| 460 // If we found any results, reset the focus tracker, so we always | 461 // If we found any results, reset the focus tracker, so we always |
| 461 // restore focus to the tab contents. | 462 // restore focus to the tab contents. |
| 462 if (result.number_of_matches() > 0) | 463 if (result.number_of_matches() > 0) |
| 463 focusTracker_.reset(nil); | 464 focusTracker_.reset(nil); |
| 464 | 465 |
| 465 // Adjust the FindBar position, even when there are no matches (so that it | 466 // Adjust the FindBar position, even when there are no matches (so that it |
| 466 // goes back to the default position, if required). | 467 // goes back to the default position, if required). |
| 467 [self moveFindBarIfNecessary:[self isFindBarVisible]]; | 468 [self moveFindBarIfNecessary:[self isFindBarVisible]]; |
| 468 } | 469 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 } | 657 } |
| 657 | 658 |
| 658 - (BrowserWindowController*)browserWindowController { | 659 - (BrowserWindowController*)browserWindowController { |
| 659 if (!browser_) | 660 if (!browser_) |
| 660 return nil; | 661 return nil; |
| 661 return [BrowserWindowController | 662 return [BrowserWindowController |
| 662 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()]; | 663 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()]; |
| 663 } | 664 } |
| 664 | 665 |
| 665 @end | 666 @end |
| OLD | NEW |