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

Unified Diff: chrome/browser/download/download_danger_prompt.cc

Issue 18179004: Dismiss action in tab modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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: chrome/browser/download/download_danger_prompt.cc
diff --git a/chrome/browser/download/download_danger_prompt.cc b/chrome/browser/download/download_danger_prompt.cc
index bdd75cc4d58c2eb7c6cc8cabcdf19b80154d5bef..892d891394a5c1911b6150626ea93ff62d6925fb 100644
--- a/chrome/browser/download/download_danger_prompt.cc
+++ b/chrome/browser/download/download_danger_prompt.cc
@@ -42,6 +42,7 @@ class DownloadDangerPromptImpl
virtual string16 GetAcceptButtonTitle() OVERRIDE;
virtual void OnAccepted() OVERRIDE;
virtual void OnCanceled() OVERRIDE;
+ virtual void OnDismissed() OVERRIDE;
// Runs |callback|. PrepareToClose() is called beforehand. Doing so prevents
// this object from responding to state changes in |download_| that might
@@ -146,6 +147,10 @@ void DownloadDangerPromptImpl::OnCanceled() {
RunCallback(canceled_);
}
+void DownloadDangerPromptImpl::OnDismissed() {
+ RunCallback(canceled_);
fdoray 2013/06/28 15:32:59 Should I call OnCanceled here to avoid code duplic
benjhayden 2013/06/28 16:05:46 I have a slight preference for calling RunCallback
+}
+
void DownloadDangerPromptImpl::RunCallback(const base::Closure& callback) {
// Invoking the callback can cause the download item state to change or cause
// the constrained window to close, and |callback| refers to a member
« no previous file with comments | « no previous file | chrome/browser/repost_form_warning_controller.h » ('j') | chrome/browser/ui/tab_modal_confirm_dialog_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698