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

Unified Diff: ios/chrome/browser/ui/dialogs/dialog_presenter.h

Issue 2957423002: Check page URL origin to determine JavaScript alert titles. (Closed)
Patch Set: 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/chrome/browser/ui/dialogs/dialog_presenter.h
diff --git a/ios/chrome/browser/ui/dialogs/dialog_presenter.h b/ios/chrome/browser/ui/dialogs/dialog_presenter.h
index 33d38b8c4bfc9ccda6d6928e8d41ff9cc31d20be..75cbbc7762a4e266dbd9e2d136925396ada55b70 100644
--- a/ios/chrome/browser/ui/dialogs/dialog_presenter.h
+++ b/ios/chrome/browser/ui/dialogs/dialog_presenter.h
@@ -77,9 +77,17 @@ class WebState;
// view controller.
- (void)tryToPresent;
-// Create an title for the alert base on the URL.
+// Create an title for the alert base on the URL (|pageURL|). Assumes that
+// pageURL is the mainFrameURL. (See
+// localizedTItleForJavaScriptAlertFromPage:mainFrameURL).
+ (NSString*)localizedTitleForJavaScriptAlertFromPage:(const GURL&)pageURL;
Eugene But (OOO till 7-30) 2017/06/29 01:00:01 Do we even need this method? It is only used in EG
PL 2017/06/29 20:02:21 Sure thing! I did think about this, and whether it
+// Create an title for the alert base on the URL (|pageURL|), and its
Eugene But (OOO till 7-30) 2017/06/29 01:00:01 s/Create/Creates
PL 2017/06/29 20:02:21 Arg, done!
+// relationship to the |mainFrameURL| (typically these are identical except for
+// when posting alerts from an embedded iframe).
++ (NSString*)localizedTitleForJavaScriptAlertFromPage:(const GURL&)pageURL
Eugene But (OOO till 7-30) 2017/06/29 01:00:01 Do we even need this method in the public interfac
PL 2017/06/29 20:02:21 It's only going to be used by the EGTest, but I th
Eugene But (OOO till 7-30) 2017/06/29 20:35:10 Can we just hardcode the title in those tests? A a
+ mainFrameURL:(const GURL&)mainFrameURL;
+
@end
@interface DialogPresenter (ExposedForTesting)
« no previous file with comments | « no previous file | ios/chrome/browser/ui/dialogs/dialog_presenter.mm » ('j') | ios/chrome/browser/ui/dialogs/dialog_presenter.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698