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

Unified Diff: chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm

Issue 1714573002: Remove the ability of webpages to specify strings for the onbeforeunload dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 4 years, 9 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
« no previous file with comments | « android_webview/ui/grit_components_whitelist.txt ('k') | components/app_modal/javascript_dialog_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm
index 51f96a0da3fc25cf35ab3df7b303203e179243ed..a9c7a833c60f8dada5ee5327634d7a8fe5c0481c 100644
--- a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm
+++ b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm
@@ -83,10 +83,14 @@ const int kMessageTextMaxSlots = 2000;
- (NSAlert*)alert {
if (!alert_) {
alert_.reset([[NSAlert alloc] init]);
- // Set a blank icon.
- NSImage* image =
- [[[NSImage alloc] initWithSize:NSMakeSize(1, 1)] autorelease];
- [alert_ setIcon:image];
+ if (!nativeDialog_->dialog()->is_before_unload_dialog()) {
+ // Set a blank icon for dialogs with text provided by the page.
+ // "onbeforeunload" dialogs don't have text provided by the page, so it's
+ // OK to use the app icon.
+ NSImage* image =
+ [[[NSImage alloc] initWithSize:NSMakeSize(1, 1)] autorelease];
+ [alert_ setIcon:image];
+ }
}
return alert_;
}
« no previous file with comments | « android_webview/ui/grit_components_whitelist.txt ('k') | components/app_modal/javascript_dialog_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698