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

Side by Side Diff: ios/web/web_state/web_state_impl.h

Issue 2074733002: Add public API for handling Javascript alerts and prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace BOOL with bool in unittest. Created 4 years, 5 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/web/web_state/web_state_delegate_stub.mm ('k') | ios/web/web_state/web_state_impl.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ 5 #ifndef IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_
6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ 6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "base/observer_list.h" 18 #include "base/observer_list.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #include "ios/web/navigation/navigation_manager_delegate.h" 20 #include "ios/web/navigation/navigation_manager_delegate.h"
21 #include "ios/web/navigation/navigation_manager_impl.h" 21 #include "ios/web/navigation/navigation_manager_impl.h"
22 #include "ios/web/net/request_tracker_impl.h" 22 #include "ios/web/net/request_tracker_impl.h"
23 #import "ios/web/public/java_script_dialog_callback.h"
24 #include "ios/web/public/java_script_dialog_type.h"
23 #include "ios/web/public/web_state/web_state.h" 25 #include "ios/web/public/web_state/web_state.h"
24 #include "url/gurl.h" 26 #include "url/gurl.h"
25 27
26 @protocol CRWRequestTrackerDelegate; 28 @protocol CRWRequestTrackerDelegate;
27 @class CRWWebController; 29 @class CRWWebController;
28 @protocol CRWWebViewProxy; 30 @protocol CRWWebViewProxy;
29 @class NSURLRequest; 31 @class NSURLRequest;
30 @class NSURLResponse; 32 @class NSURLResponse;
31 33
32 namespace net { 34 namespace net {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 void ShowWebInterstitial(WebInterstitialImpl* interstitial); 262 void ShowWebInterstitial(WebInterstitialImpl* interstitial);
261 263
262 // Called to dismiss the currently-displayed transient content view. 264 // Called to dismiss the currently-displayed transient content view.
263 void ClearTransientContentView(); 265 void ClearTransientContentView();
264 266
265 // Notifies the delegate that the load progress was updated. 267 // Notifies the delegate that the load progress was updated.
266 void SendChangeLoadProgress(double progress); 268 void SendChangeLoadProgress(double progress);
267 // Notifies the delegate that a context menu needs handling. 269 // Notifies the delegate that a context menu needs handling.
268 bool HandleContextMenu(const ContextMenuParams& params); 270 bool HandleContextMenu(const ContextMenuParams& params);
269 271
272 // Notifies the delegate that a JavaScript dialog needs to be presented.
273 void RunJavaScriptDialog(const GURL& origin_url,
274 JavaScriptDialogType java_script_dialog_type,
275 NSString* message_text,
276 NSString* default_prompt_text,
277 const DialogClosedCallback& callback);
278
279 // Cancels all dialogs associated with this web_state.
280 void CancelActiveAndPendingDialogs();
281
270 // NavigationManagerDelegate: 282 // NavigationManagerDelegate:
271 void NavigateToPendingEntry() override; 283 void NavigateToPendingEntry() override;
272 void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; 284 void LoadURLWithParams(const NavigationManager::WebLoadParams&) override;
273 void OnNavigationItemsPruned(size_t pruned_item_count) override; 285 void OnNavigationItemsPruned(size_t pruned_item_count) override;
274 void OnNavigationItemChanged() override; 286 void OnNavigationItemChanged() override;
275 void OnNavigationItemCommitted( 287 void OnNavigationItemCommitted(
276 const LoadCommittedDetails& load_details) override; 288 const LoadCommittedDetails& load_details) override;
277 WebState* GetWebState() override; 289 WebState* GetWebState() override;
278 290
279 protected: 291 protected:
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 371
360 // Mojo interface registry for this WebState. 372 // Mojo interface registry for this WebState.
361 std::unique_ptr<shell::InterfaceRegistry> mojo_interface_registry_; 373 std::unique_ptr<shell::InterfaceRegistry> mojo_interface_registry_;
362 374
363 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); 375 DISALLOW_COPY_AND_ASSIGN(WebStateImpl);
364 }; 376 };
365 377
366 } // namespace web 378 } // namespace web
367 379
368 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ 380 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_
OLDNEW
« no previous file with comments | « ios/web/web_state/web_state_delegate_stub.mm ('k') | ios/web/web_state/web_state_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698