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

Side by Side Diff: components/autofill/ios/browser/js_suggestion_manager.mm

Issue 2849533003: [ObjC ARC] Converts components/autofill/ios/browser:browser to ARC. (Closed)
Patch Set: Address comments Created 3 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/ios/browser/js_suggestion_manager.h" 5 #import "components/autofill/ios/browser/js_suggestion_manager.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/json/string_escape.h" 8 #include "base/json/string_escape.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
11 11
12 #if !defined(__has_feature) || !__has_feature(objc_arc)
13 #error "This file requires ARC support."
14 #endif
15
12 namespace { 16 namespace {
13 // Santizies |str| and wraps it in quotes so it can be injected safely in 17 // Santizies |str| and wraps it in quotes so it can be injected safely in
14 // JavaScript. 18 // JavaScript.
15 NSString* JSONEscape(NSString* str) { 19 NSString* JSONEscape(NSString* str) {
16 return base::SysUTF8ToNSString( 20 return base::SysUTF8ToNSString(
17 base::GetQuotedJSONString(base::SysNSStringToUTF8(str))); 21 base::GetQuotedJSONString(base::SysNSStringToUTF8(str)));
18 } 22 }
19 } // namespace 23 } // namespace
20 24
21 @implementation JsSuggestionManager 25 @implementation JsSuggestionManager
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 completionHandler(hasPreviousElement, hasNextElement); 99 completionHandler(hasPreviousElement, hasNextElement);
96 }]; 100 }];
97 } 101 }
98 102
99 - (void)closeKeyboard { 103 - (void)closeKeyboard {
100 [self executeJavaScript:@"document.activeElement.blur()" 104 [self executeJavaScript:@"document.activeElement.blur()"
101 completionHandler:nil]; 105 completionHandler:nil];
102 } 106 }
103 107
104 @end 108 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698