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

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

Issue 2930763003: [iOS Clean] Added HTTP authentication dialog support.
Patch Set: rebase && Mark's comments 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
« no previous file with comments | « ios/clean/chrome/browser/ui/web_contents/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/clean/chrome/browser/ui/web_contents/web_coordinator.h" 5 #import "ios/clean/chrome/browser/ui/web_contents/web_coordinator.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #import "ios/clean/chrome/browser/ui/commands/context_menu_commands.h" 9 #import "ios/clean/chrome/browser/ui/commands/context_menu_commands.h"
10 #import "ios/clean/chrome/browser/ui/context_menu/context_menu_context_impl.h" 10 #import "ios/clean/chrome/browser/ui/context_menu/context_menu_context_impl.h"
11 #import "ios/clean/chrome/browser/ui/context_menu/web_context_menu_coordinator.h " 11 #import "ios/clean/chrome/browser/ui/context_menu/web_context_menu_coordinator.h "
12 #import "ios/clean/chrome/browser/ui/dialogs/http_auth_dialogs/http_auth_dialog_ coordinator.h"
13 #import "ios/clean/chrome/browser/ui/dialogs/http_auth_dialogs/http_auth_dialog_ request.h"
12 #import "ios/clean/chrome/browser/ui/overlay_service/browser_coordinator+overlay _support.h" 14 #import "ios/clean/chrome/browser/ui/overlay_service/browser_coordinator+overlay _support.h"
13 #import "ios/clean/chrome/browser/ui/overlay_service/overlay_service.h" 15 #import "ios/clean/chrome/browser/ui/overlay_service/overlay_service.h"
14 #import "ios/clean/chrome/browser/ui/web_contents/web_contents_mediator.h" 16 #import "ios/clean/chrome/browser/ui/web_contents/web_contents_mediator.h"
15 #import "ios/clean/chrome/browser/ui/web_contents/web_contents_view_controller.h " 17 #import "ios/clean/chrome/browser/ui/web_contents/web_contents_view_controller.h "
16 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" 18 #import "ios/shared/chrome/browser/ui/browser_list/browser.h"
17 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h" 19 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h"
18 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal. h" 20 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal. h"
19 #include "ios/web/public/navigation_manager.h" 21 #include "ios/web/public/navigation_manager.h"
20 #include "ios/web/public/web_state/web_state.h" 22 #include "ios/web/public/web_state/web_state.h"
21 #import "ios/web/public/web_state/web_state_delegate_bridge.h" 23 #import "ios/web/public/web_state/web_state_delegate_bridge.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 handleContextMenu:(const web::ContextMenuParams&)params { 118 handleContextMenu:(const web::ContextMenuParams&)params {
117 ContextMenuContextImpl* context = 119 ContextMenuContextImpl* context =
118 [[ContextMenuContextImpl alloc] initWithParams:params]; 120 [[ContextMenuContextImpl alloc] initWithParams:params];
119 WebContextMenuCoordinator* contextMenu = 121 WebContextMenuCoordinator* contextMenu =
120 [[WebContextMenuCoordinator alloc] initWithContext:context]; 122 [[WebContextMenuCoordinator alloc] initWithContext:context];
121 [self addChildCoordinator:contextMenu]; 123 [self addChildCoordinator:contextMenu];
122 [contextMenu start]; 124 [contextMenu start];
123 return YES; 125 return YES;
124 } 126 }
125 127
128 - (void)webState:(web::WebState*)webState
129 didRequestHTTPAuthForProtectionSpace:(NSURLProtectionSpace*)protectionSpace
130 proposedCredential:(NSURLCredential*)proposedCredential
131 completionHandler:(void (^)(NSString* username,
132 NSString* password))handler {
133 HTTPAuthDialogRequest* request =
134 [HTTPAuthDialogRequest stateWithWebState:webState
135 protectionSpace:protectionSpace
136 credential:proposedCredential
137 callback:handler];
138 HTTPAuthDialogCoordinator* dialogCoordinator =
139 [[HTTPAuthDialogCoordinator alloc] initWithRequest:request];
140 self.overlayService->ShowOverlayForWebState(dialogCoordinator, webState);
141 }
142
126 @end 143 @end
OLDNEW
« no previous file with comments | « ios/clean/chrome/browser/ui/web_contents/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698