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

Side by Side Diff: ios/chrome/browser/find_in_page/find_in_page_controller.mm

Issue 1614913002: Fixes disappearing text in Find in page toolbar in slide over. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "ios/chrome/browser/find_in_page/find_in_page_controller.h" 5 #import "ios/chrome/browser/find_in_page/find_in_page_controller.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 #import <cmath> 8 #import <cmath>
9 9
10 #include "base/ios/ios_util.h" 10 #include "base/ios/ios_util.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } else { 283 } else {
284 handler(); 284 handler();
285 } 285 }
286 } 286 }
287 287
288 - (void)saveSearchTerm { 288 - (void)saveSearchTerm {
289 [self findPasteboard].string = [[self findInPageModel] text]; 289 [self findPasteboard].string = [[self findInPageModel] text];
290 } 290 }
291 291
292 - (void)restoreSearchTerm { 292 - (void)restoreSearchTerm {
293 // Pasteboards always return nil in background:
294 if ([[UIApplication sharedApplication] applicationState] !=
295 UIApplicationStateActive) {
296 return;
297 }
298
293 NSString* term = [self findPasteboard].string; 299 NSString* term = [self findPasteboard].string;
294 [[self findInPageModel] updateQuery:(term ? term : @"") matches:0]; 300 [[self findInPageModel] updateQuery:(term ? term : @"") matches:0];
295 } 301 }
296 302
297 - (UIPasteboard*)findPasteboard { 303 - (UIPasteboard*)findPasteboard {
298 return [UIPasteboard pasteboardWithName:UIPasteboardNameFind create:NO]; 304 return [UIPasteboard pasteboardWithName:UIPasteboardNameFind create:NO];
299 } 305 }
300 306
301 - (web::WebState*)webState { 307 - (web::WebState*)webState {
302 return _webStateObserverBridge ? _webStateObserverBridge->web_state() 308 return _webStateObserverBridge ? _webStateObserverBridge->web_state()
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 375
370 - (BOOL)canReleaseDOMLock { 376 - (BOOL)canReleaseDOMLock {
371 return NO; 377 return NO;
372 } 378 }
373 379
374 - (void)releaseDOMLockWithCompletionHandler:(ProceduralBlock)completionHandler { 380 - (void)releaseDOMLockWithCompletionHandler:(ProceduralBlock)completionHandler {
375 NOTREACHED(); 381 NOTREACHED();
376 } 382 }
377 383
378 @end 384 @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