Autofill: code cleanup.
[chromium-blink-merge.git] / chrome / browser / repost_form_warning_controller.cc
blob0dadfc92e45fa35a822432c6dfaa3eab4ae4bf92
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/repost_form_warning_controller.h"
7 #include "chrome/grit/generated_resources.h"
8 #include "content/public/browser/navigation_controller.h"
9 #include "content/public/browser/web_contents.h"
10 #include "ui/base/l10n/l10n_util.h"
12 RepostFormWarningController::RepostFormWarningController(
13 content::WebContents* web_contents)
14 : TabModalConfirmDialogDelegate(web_contents),
15 content::WebContentsObserver(web_contents) {
18 RepostFormWarningController::~RepostFormWarningController() {
21 base::string16 RepostFormWarningController::GetTitle() {
22 return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE);
25 base::string16 RepostFormWarningController::GetDialogMessage() {
26 return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING);
29 base::string16 RepostFormWarningController::GetAcceptButtonTitle() {
30 return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_RESEND);
33 void RepostFormWarningController::OnAccepted() {
34 web_contents()->GetController().ContinuePendingReload();
37 void RepostFormWarningController::OnCanceled() {
38 web_contents()->GetController().CancelPendingReload();
41 void RepostFormWarningController::OnClosed() {
42 web_contents()->GetController().CancelPendingReload();
45 void RepostFormWarningController::BeforeFormRepostWarningShow() {
46 // Close the dialog if we show an additional dialog, to avoid them
47 // stacking up.
48 Cancel();