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

Unified Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 11187032: Handle resubmission of HTTP Posts. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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: content/browser/web_contents/navigation_controller_impl.cc
diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc
index 150c5dc77e312a1cc836475b4d7ea88bbed615a2..ed51e4c00e124af857784a70b8514aef3ccdc8ba 100644
--- a/content/browser/web_contents/navigation_controller_impl.cc
+++ b/content/browser/web_contents/navigation_controller_impl.cc
@@ -310,13 +310,17 @@ void NavigationControllerImpl::ReloadInternal(bool check_for_repost,
// The user is asking to reload a page with POST data. Prompt to make sure
// they really want to do this. If they do, the dialog will call us back
// with check_for_repost = false.
- content::NotificationService::current()->Notify(
- content::NOTIFICATION_REPOST_WARNING_SHOWN,
- content::Source<NavigationController>(this),
- content::NotificationService::NoDetails());
-
+ if (content::NotificationService::current()) {
+ // TODO(sgurun): What is the proper way to handle this? create in
+ // contentviewcore?
+ content::NotificationService::current()->Notify(
+ content::NOTIFICATION_REPOST_WARNING_SHOWN,
+ content::Source<NavigationController>(this),
+ content::NotificationService::NoDetails());
+ }
pending_reload_ = reload_type;
web_contents_->Activate();
+ // TODO(sgurun): change the name to onFormResubmission http://crbug/156461
web_contents_->GetDelegate()->ShowRepostFormWarningDialog(web_contents_);
} else {
DiscardNonCommittedEntriesInternal();

Powered by Google App Engine
This is Rietveld 408576698