OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/autofill/form_suggestion_controller.h" | 5 #import "ios/chrome/browser/autofill/form_suggestion_controller.h" |
6 | 6 |
7 #include "base/ios/ios_util.h" | 7 #include "base/ios/ios_util.h" |
8 #include "base/ios/weak_nsobject.h" | 8 #include "base/ios/weak_nsobject.h" |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/mac/scoped_block.h" | 10 #include "base/mac/scoped_block.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 @end | 84 @end |
85 | 85 |
86 @implementation FormSuggestionController { | 86 @implementation FormSuggestionController { |
87 // Bridge to observe the web state from Objective-C. | 87 // Bridge to observe the web state from Objective-C. |
88 scoped_ptr<web::WebStateObserverBridge> _webStateObserverBridge; | 88 scoped_ptr<web::WebStateObserverBridge> _webStateObserverBridge; |
89 | 89 |
90 // Manager for FormSuggestion JavaScripts. | 90 // Manager for FormSuggestion JavaScripts. |
91 base::scoped_nsobject<JsSuggestionManager> _jsSuggestionManager; | 91 base::scoped_nsobject<JsSuggestionManager> _jsSuggestionManager; |
92 | 92 |
93 // The provider for the current set of suggestions. | 93 // The provider for the current set of suggestions. |
94 __weak id<FormSuggestionProvider> _provider; | 94 id<FormSuggestionProvider> _provider; // weak |
95 } | 95 } |
96 | 96 |
97 - (instancetype)initWithWebState:(web::WebState*)webState | 97 - (instancetype)initWithWebState:(web::WebState*)webState |
98 providers:(NSArray*)providers | 98 providers:(NSArray*)providers |
99 JsSuggestionManager:(JsSuggestionManager*)jsSuggestionManager { | 99 JsSuggestionManager:(JsSuggestionManager*)jsSuggestionManager { |
100 self = [super init]; | 100 self = [super init]; |
101 if (self) { | 101 if (self) { |
102 _webStateObserverBridge.reset( | 102 _webStateObserverBridge.reset( |
103 new web::WebStateObserverBridge(webState, self)); | 103 new web::WebStateObserverBridge(webState, self)); |
104 _webViewProxy.reset([webState->GetWebViewProxy() retain]); | 104 _webViewProxy.reset([webState->GetWebViewProxy() retain]); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 - (void)resizeAccessoryView { | 364 - (void)resizeAccessoryView { |
365 [self updateKeyboard:_suggestionState.get()]; | 365 [self updateKeyboard:_suggestionState.get()]; |
366 } | 366 } |
367 | 367 |
368 - (BOOL)getLogKeyboardAccessoryMetrics { | 368 - (BOOL)getLogKeyboardAccessoryMetrics { |
369 return YES; | 369 return YES; |
370 } | 370 } |
371 | 371 |
372 @end | 372 @end |
OLD | NEW |