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

Side by Side 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: call Reload in correct thread 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/web_contents/navigation_controller_impl.h" 5 #include "content/browser/web_contents/navigation_controller_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" // Temporary 10 #include "base/string_number_conversions.h" // Temporary
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 // The user is asking to reload a page with POST data. Prompt to make sure 310 // The user is asking to reload a page with POST data. Prompt to make sure
311 // they really want to do this. If they do, the dialog will call us back 311 // they really want to do this. If they do, the dialog will call us back
312 // with check_for_repost = false. 312 // with check_for_repost = false.
313 content::NotificationService::current()->Notify( 313 content::NotificationService::current()->Notify(
314 content::NOTIFICATION_REPOST_WARNING_SHOWN, 314 content::NOTIFICATION_REPOST_WARNING_SHOWN,
315 content::Source<NavigationController>(this), 315 content::Source<NavigationController>(this),
316 content::NotificationService::NoDetails()); 316 content::NotificationService::NoDetails());
317 317
318 pending_reload_ = reload_type; 318 pending_reload_ = reload_type;
319 web_contents_->Activate(); 319 web_contents_->Activate();
320 // TODO(sgurun): change the name to onFormResubmission http://crbug/156461
320 web_contents_->GetDelegate()->ShowRepostFormWarningDialog(web_contents_); 321 web_contents_->GetDelegate()->ShowRepostFormWarningDialog(web_contents_);
321 } else { 322 } else {
322 DiscardNonCommittedEntriesInternal(); 323 DiscardNonCommittedEntriesInternal();
323 324
324 NavigationEntryImpl* entry = entries_[current_index].get(); 325 NavigationEntryImpl* entry = entries_[current_index].get();
325 SiteInstanceImpl* site_instance = entry->site_instance(); 326 SiteInstanceImpl* site_instance = entry->site_instance();
326 DCHECK(site_instance); 327 DCHECK(site_instance);
327 328
328 // If we are reloading an entry that no longer belongs to the current 329 // If we are reloading an entry that no longer belongs to the current
329 // site instance (for example, refreshing a page for just installed app), 330 // site instance (for example, refreshing a page for just installed app),
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 linked_ptr<NavigationEntryImpl>( 1621 linked_ptr<NavigationEntryImpl>(
1621 new NavigationEntryImpl(*source.entries_[i]))); 1622 new NavigationEntryImpl(*source.entries_[i])));
1622 } 1623 }
1623 } 1624 }
1624 } 1625 }
1625 1626
1626 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1627 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1627 const base::Callback<base::Time()>& get_timestamp_callback) { 1628 const base::Callback<base::Time()>& get_timestamp_callback) {
1628 get_timestamp_callback_ = get_timestamp_callback; 1629 get_timestamp_callback_ = get_timestamp_callback;
1629 } 1630 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698