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

Unified Diff: ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm

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 side-by-side diff with in-line comments
Download patch
Index: ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
diff --git a/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm b/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
index 8275a7fc17c5f9c81fd04d7da1b78ac2ad5c5d68..0c10e3a550221e4f47eab3607ed74cc2cacc4a04 100644
--- a/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
+++ b/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
@@ -10,6 +10,8 @@
#import "ios/clean/chrome/browser/ui/commands/overlay_commands.h"
#import "ios/clean/chrome/browser/ui/context_menu/context_menu_context_impl.h"
#import "ios/clean/chrome/browser/ui/context_menu/web_context_menu_coordinator.h"
+#import "ios/clean/chrome/browser/ui/dialogs/http_auth_dialogs/http_auth_dialog_coordinator.h"
+#import "ios/clean/chrome/browser/ui/dialogs/http_auth_dialogs/http_auth_dialog_state.h"
#import "ios/clean/chrome/browser/ui/overlays/overlay_queue.h"
#import "ios/clean/chrome/browser/ui/web_contents/web_contents_mediator.h"
#import "ios/clean/chrome/browser/ui/web_contents/web_contents_view_controller.h"
@@ -134,6 +136,22 @@ - (BOOL)webState:(web::WebState*)webState
return YES;
}
+- (void)webState:(web::WebState*)webState
+ didRequestHTTPAuthForProtectionSpace:(NSURLProtectionSpace*)protectionSpace
+ proposedCredential:(NSURLCredential*)proposedCredential
+ completionHandler:(void (^)(NSString* username,
+ NSString* password))handler {
+ HTTPAuthDialogState* state =
+ [HTTPAuthDialogState stateWithWebState:webState
+ protectionSpace:protectionSpace
+ credential:proposedCredential
+ callback:handler];
+ HTTPAuthDialogCoordinator* coordinator =
+ [[HTTPAuthDialogCoordinator alloc] initWithState:state];
+ [self createDialogHelpers];
+ OverlayQueue::FromWebState(webState)->AddOverlay(coordinator);
+}
+
#pragma mark - OverlayPresentationCommands
- (void)startNextOverlayForWebState:(web::WebState*)webState {

Powered by Google App Engine
This is Rietveld 408576698