| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/repost_form_warning_controller.h" | 5 #include "chrome/browser/repost_form_warning_controller.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include "content/public/browser/navigation_controller.h" | 11 #include "content/public/browser/navigation_controller.h" |
| 12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
| 13 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 | 15 |
| 16 RepostFormWarningController::RepostFormWarningController( | 16 RepostFormWarningController::RepostFormWarningController( |
| 17 content::WebContents* web_contents) | 17 content::WebContents* web_contents) |
| 18 : TabModalConfirmDialogDelegate(web_contents), | 18 : content::WebContentsObserver(web_contents) { |
| 19 content::WebContentsObserver(web_contents) { | |
| 20 } | 19 } |
| 21 | 20 |
| 22 RepostFormWarningController::~RepostFormWarningController() { | 21 RepostFormWarningController::~RepostFormWarningController() { |
| 23 } | 22 } |
| 24 | 23 |
| 25 string16 RepostFormWarningController::GetTitle() { | 24 string16 RepostFormWarningController::GetTitle() { |
| 26 return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE); | 25 return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE); |
| 27 } | 26 } |
| 28 | 27 |
| 29 string16 RepostFormWarningController::GetMessage() { | 28 string16 RepostFormWarningController::GetMessage() { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 52 | 51 |
| 53 void RepostFormWarningController::OnCanceled() { | 52 void RepostFormWarningController::OnCanceled() { |
| 54 web_contents()->GetController().CancelPendingReload(); | 53 web_contents()->GetController().CancelPendingReload(); |
| 55 } | 54 } |
| 56 | 55 |
| 57 void RepostFormWarningController::BeforeFormRepostWarningShow() { | 56 void RepostFormWarningController::BeforeFormRepostWarningShow() { |
| 58 // Close the dialog if we show an additional dialog, to avoid them | 57 // Close the dialog if we show an additional dialog, to avoid them |
| 59 // stacking up. | 58 // stacking up. |
| 60 Cancel(); | 59 Cancel(); |
| 61 } | 60 } |
| OLD | NEW |