OLD | NEW |
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/java_script_dialogs/java_script_dia
log_overlay_presenter.h" |
12 #import "ios/clean/chrome/browser/ui/overlay_service/browser_coordinator+overlay
_support.h" | 13 #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" | 14 #import "ios/clean/chrome/browser/ui/overlay_service/overlay_service.h" |
14 #import "ios/clean/chrome/browser/ui/web_contents/web_contents_mediator.h" | 15 #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
" | 16 #import "ios/clean/chrome/browser/ui/web_contents/web_contents_view_controller.h
" |
16 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" | 17 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" |
17 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h" | 18 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h" |
18 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.
h" | 19 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.
h" |
19 #include "ios/web/public/navigation_manager.h" | 20 #include "ios/web/public/navigation_manager.h" |
20 #include "ios/web/public/web_state/web_state.h" | 21 #include "ios/web/public/web_state/web_state.h" |
21 #import "ios/web/public/web_state/web_state_delegate_bridge.h" | 22 #import "ios/web/public/web_state/web_state_delegate_bridge.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 106 |
106 - (void)openContextMenuImage:(ContextMenuContext*)context { | 107 - (void)openContextMenuImage:(ContextMenuContext*)context { |
107 ContextMenuContextImpl* contextImpl = | 108 ContextMenuContextImpl* contextImpl = |
108 base::mac::ObjCCastStrict<ContextMenuContextImpl>(context); | 109 base::mac::ObjCCastStrict<ContextMenuContextImpl>(context); |
109 web::NavigationManager::WebLoadParams loadParams(contextImpl.imageURL); | 110 web::NavigationManager::WebLoadParams loadParams(contextImpl.imageURL); |
110 self.webState->GetNavigationManager()->LoadURLWithParams(loadParams); | 111 self.webState->GetNavigationManager()->LoadURLWithParams(loadParams); |
111 } | 112 } |
112 | 113 |
113 #pragma mark - CRWWebStateDelegate | 114 #pragma mark - CRWWebStateDelegate |
114 | 115 |
| 116 - (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState: |
| 117 (web::WebState*)webState { |
| 118 JavaScriptDialogOverlayPresenter::CreateForWebState(self.webState, |
| 119 self.overlayService); |
| 120 return JavaScriptDialogOverlayPresenter::FromWebState(webState); |
| 121 } |
| 122 |
115 - (BOOL)webState:(web::WebState*)webState | 123 - (BOOL)webState:(web::WebState*)webState |
116 handleContextMenu:(const web::ContextMenuParams&)params { | 124 handleContextMenu:(const web::ContextMenuParams&)params { |
117 ContextMenuContextImpl* context = | 125 ContextMenuContextImpl* context = |
118 [[ContextMenuContextImpl alloc] initWithParams:params]; | 126 [[ContextMenuContextImpl alloc] initWithParams:params]; |
119 WebContextMenuCoordinator* contextMenu = | 127 WebContextMenuCoordinator* contextMenu = |
120 [[WebContextMenuCoordinator alloc] initWithContext:context]; | 128 [[WebContextMenuCoordinator alloc] initWithContext:context]; |
121 [self addChildCoordinator:contextMenu]; | 129 [self addChildCoordinator:contextMenu]; |
122 [contextMenu start]; | 130 [contextMenu start]; |
123 return YES; | 131 return YES; |
124 } | 132 } |
125 | 133 |
126 @end | 134 @end |
OLD | NEW |