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

Side by Side Diff: ios/chrome/browser/ui/dialogs/dialog_presenter.h

Issue 2957423002: Check page URL origin to determine JavaScript alert titles. (Closed)
Patch Set: Small tweak Created 3 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 | « no previous file | ios/chrome/browser/ui/dialogs/dialog_presenter.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_CHROME_BROWSER_UI_DIALOGS_DIALOG_PRESENTER_H_ 5 #ifndef IOS_CHROME_BROWSER_UI_DIALOGS_DIALOG_PRESENTER_H_
6 #define IOS_CHROME_BROWSER_UI_DIALOGS_DIALOG_PRESENTER_H_ 6 #define IOS_CHROME_BROWSER_UI_DIALOGS_DIALOG_PRESENTER_H_
7 7
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #import "base/ios/block_types.h" 10 #import "base/ios/block_types.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 - (void)cancelDialogForWebState:(web::WebState*)webState; 70 - (void)cancelDialogForWebState:(web::WebState*)webState;
71 71
72 // Dismisses the currently presented dialog and cancels all queued dialogs. 72 // Dismisses the currently presented dialog and cancels all queued dialogs.
73 - (void)cancelAllDialogs; 73 - (void)cancelAllDialogs;
74 74
75 // Tries to present an alert if needed and possible. Called by the view 75 // Tries to present an alert if needed and possible. Called by the view
76 // controller which will present the alert to notify that it has dismissed a 76 // controller which will present the alert to notify that it has dismissed a
77 // view controller. 77 // view controller.
78 - (void)tryToPresent; 78 - (void)tryToPresent;
79 79
80 // Create an title for the alert base on the URL.
81 + (NSString*)localizedTitleForJavaScriptAlertFromPage:(const GURL&)pageURL;
82
83 @end 80 @end
84 81
85 @interface DialogPresenter (ExposedForTesting) 82 @interface DialogPresenter (ExposedForTesting)
86 // The dialog currently being shown. 83 // The dialog currently being shown.
87 @property(nonatomic, readonly) AlertCoordinator* presentedDialogCoordinator; 84 @property(nonatomic, readonly) AlertCoordinator* presentedDialogCoordinator;
88 85
89 // Called when |coordinator| is stopped. 86 // Called when |coordinator| is stopped.
90 - (void)dialogCoordinatorWasStopped:(AlertCoordinator*)coordinator; 87 - (void)dialogCoordinatorWasStopped:(AlertCoordinator*)coordinator;
91 88
92 @end 89 @end
93 90
94 // Delegate protocol for DialogPresenter. 91 // Delegate protocol for DialogPresenter.
95 @protocol DialogPresenterDelegate<NSObject> 92 @protocol DialogPresenterDelegate<NSObject>
96 93
97 // Called by |presenter| before showing the queued modal dialog associated with 94 // Called by |presenter| before showing the queued modal dialog associated with
98 // |context|. 95 // |context|.
99 - (void)dialogPresenter:(DialogPresenter*)presenter 96 - (void)dialogPresenter:(DialogPresenter*)presenter
100 willShowDialogForWebState:(web::WebState*)webState; 97 willShowDialogForWebState:(web::WebState*)webState;
101 98
102 // Whether the delegate is presenting another View Controller. 99 // Whether the delegate is presenting another View Controller.
103 @property(nonatomic, assign) BOOL presenting; 100 @property(nonatomic, assign) BOOL presenting;
104 101
105 @end 102 @end
106 103
107 #endif // IOS_CHROME_BROWSER_UI_DIALOGS_DIALOG_PRESENTER_H_ 104 #endif // IOS_CHROME_BROWSER_UI_DIALOGS_DIALOG_PRESENTER_H_
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/dialogs/dialog_presenter.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698