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

Side by Side Diff: ios/clean/chrome/browser/ui/dialogs/http_auth_dialogs/http_auth_dialog_state.h

Issue 2930763003: [iOS Clean] Added HTTP authentication dialog support.
Patch Set: rebased, subclassed DialogMediator Created 3 years, 6 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
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698