Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm

Issue 2479883003: [Mac] Fix for find bar text issue (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698