OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_HTTP_AUTH_DIALOGS_HTTP_AUTH_DIALOG_S TATE_H_ | |
6 #define IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_HTTP_AUTH_DIALOGS_HTTP_AUTH_DIALOG_S TATE_H_ | |
7 | |
8 #import <Foundation/Foundation.h> | |
9 | |
10 namespace web { | |
11 class WebState; | |
12 } | |
13 | |
14 // Block type for HTTP authentication callbacks. | |
15 typedef void (^HTTPAuthDialogCallback)(NSString* username, NSString* password); | |
16 | |
17 // A container object encapsulating all the state necessary to support an | |
marq (ping after 24h)
2017/06/14 11:19:15
Name quibbles -- I'm not wild about "State", becau
kkhorimoto
2017/06/23 06:25:41
Done.
| |
18 // HTTPAuthDialogCoordiantor. This object also owns the WebKit | |
19 // completion block that will throw an exception if it is deallocated before | |
20 // being executed. |-runCallbackWithUserName:password:| must be executed once in | |
21 // the lifetime of every JavaScriptDialogState. | |
marq (ping after 24h)
2017/06/14 11:19:16
HTTPAuthDialogState, here an elsewhere. Careful wi
kkhorimoto
2017/06/23 06:25:41
Fixed. I don't think they should share a supercla
| |
22 @interface HTTPAuthDialogState : NSObject | |
23 | |
24 // Factory method to create JavaScriptDialogStates from the given input. | |
25 + (instancetype)stateWithWebState:(web::WebState*)webState | |
26 protectionSpace:(NSURLProtectionSpace*)protectionSpace | |
27 credential:(NSURLCredential*)credential | |
28 callback:(HTTPAuthDialogCallback)callback; | |
29 | |
30 // The WebState displaying this dialog. | |
31 @property(nonatomic, readonly) web::WebState* webState; | |
32 | |
33 // The title to use for the dialog. | |
34 @property(nonatomic, readonly) NSString* title; | |
marq (ping after 24h)
2017/06/14 11:19:15
You're marking other readonly string properties as
kkhorimoto
2017/06/23 06:25:41
Done.
| |
35 | |
36 // The authentication message for the dialog's protection space. | |
37 @property(nonatomic, readonly, strong) NSString* message; | |
38 | |
39 // The default text to display in the username text field. | |
40 @property(nonatomic, readonly, strong) NSString* defaultUserNameText; | |
41 | |
42 // Calls the callback passed on initialization with the provided parameters. | |
marq (ping after 24h)
2017/06/14 11:19:15
I regard the callback as an implementation detail.
kkhorimoto
2017/06/23 06:25:41
Done.
| |
43 - (void)runCallbackWithUserName:(NSString*)username | |
44 password:(NSString*)password; | |
45 | |
46 @end | |
47 | |
48 #endif // IOS_CLEAN_CHROME_BROWSER_UI_DIALOGS_HTTP_AUTH_DIALOGS_HTTP_AUTH_DIALO G_STATE_H_ | |
OLD | NEW |