| 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/ui/views/repost_form_warning_view.h" | 5 #include "chrome/browser/ui/views/repost_form_warning_view.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/repost_form_warning_controller.h" | 8 #include "chrome/browser/repost_form_warning_controller.h" |
| 9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 11 #include "chrome/browser/ui/views/constrained_window_views.h" | 12 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 12 #include "content/browser/tab_contents/navigation_controller.h" | 13 #include "content/browser/tab_contents/navigation_controller.h" |
| 13 #include "content/browser/tab_contents/tab_contents.h" | 14 #include "content/browser/tab_contents/tab_contents.h" |
| 14 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 15 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 16 #include "ui/base/message_box_flags.h" | 17 #include "ui/base/message_box_flags.h" |
| 17 #include "views/controls/message_box_view.h" | 18 #include "views/controls/message_box_view.h" |
| 18 | 19 |
| 19 namespace browser { | 20 namespace browser { |
| 20 | 21 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 31 | 32 |
| 32 RepostFormWarningView::RepostFormWarningView( | 33 RepostFormWarningView::RepostFormWarningView( |
| 33 gfx::NativeWindow parent_window, | 34 gfx::NativeWindow parent_window, |
| 34 TabContents* tab_contents) | 35 TabContents* tab_contents) |
| 35 : controller_(new RepostFormWarningController(tab_contents)), | 36 : controller_(new RepostFormWarningController(tab_contents)), |
| 36 message_box_view_(NULL) { | 37 message_box_view_(NULL) { |
| 37 message_box_view_ = new views::MessageBoxView( | 38 message_box_view_ = new views::MessageBoxView( |
| 38 ui::MessageBoxFlags::kIsConfirmMessageBox, | 39 ui::MessageBoxFlags::kIsConfirmMessageBox, |
| 39 UTF16ToWide(l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING)), | 40 UTF16ToWide(l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING)), |
| 40 std::wstring()); | 41 std::wstring()); |
| 41 controller_->set_window(new ConstrainedWindowViews(tab_contents, this)); | 42 TabContentsWrapper* wrapper = |
| 43 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); |
| 44 controller_->set_window(new ConstrainedWindowViews(wrapper, this)); |
| 42 } | 45 } |
| 43 | 46 |
| 44 RepostFormWarningView::~RepostFormWarningView() { | 47 RepostFormWarningView::~RepostFormWarningView() { |
| 45 } | 48 } |
| 46 | 49 |
| 47 ////////////////////////////////////////////////////////////////////////////// | 50 ////////////////////////////////////////////////////////////////////////////// |
| 48 // RepostFormWarningView, views::DialogDelegate implementation: | 51 // RepostFormWarningView, views::DialogDelegate implementation: |
| 49 | 52 |
| 50 string16 RepostFormWarningView::GetWindowTitle() const { | 53 string16 RepostFormWarningView::GetWindowTitle() const { |
| 51 return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE); | 54 return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 81 controller_->Continue(); | 84 controller_->Continue(); |
| 82 return true; | 85 return true; |
| 83 } | 86 } |
| 84 | 87 |
| 85 /////////////////////////////////////////////////////////////////////////////// | 88 /////////////////////////////////////////////////////////////////////////////// |
| 86 // RepostFormWarningView, RepostFormWarning implementation: | 89 // RepostFormWarningView, RepostFormWarning implementation: |
| 87 | 90 |
| 88 void RepostFormWarningView::DeleteDelegate() { | 91 void RepostFormWarningView::DeleteDelegate() { |
| 89 delete this; | 92 delete this; |
| 90 } | 93 } |
| OLD | NEW |