| 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/webui/repost_form_warning_ui.h" | 5 #include "chrome/browser/ui/webui/repost_form_warning_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningHtmlDelegate); | 139 DISALLOW_COPY_AND_ASSIGN(RepostFormWarningHtmlDelegate); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 RepostFormWarningUI::RepostFormWarningUI(gfx::NativeWindow parent_window, | 142 RepostFormWarningUI::RepostFormWarningUI(gfx::NativeWindow parent_window, |
| 143 TabContents* tab_contents) | 143 TabContents* tab_contents) |
| 144 : controller_(new RepostFormWarningController(tab_contents)) { | 144 : controller_(new RepostFormWarningController(tab_contents)) { |
| 145 TabContentsWrapper* wrapper = | 145 TabContentsWrapper* wrapper = |
| 146 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); | 146 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); |
| 147 Profile* profile = wrapper->profile(); | 147 Profile* profile = wrapper->profile(); |
| 148 RepostFormWarningSource::RegisterDataSource(profile); | 148 RepostFormWarningSource::RegisterDataSource(profile); |
| 149 RepostFormWarningHtmlDelegate* delegate = | 149 RepostFormWarningHtmlDelegate* html_delegate = |
| 150 new RepostFormWarningHtmlDelegate(this); | 150 new RepostFormWarningHtmlDelegate(this); |
| 151 ConstrainedHtmlUI::CreateConstrainedHtmlDialog(profile, delegate, wrapper); | 151 ConstrainedHtmlUIDelegate* dialog_delegate = |
| 152 ConstrainedHtmlUI::CreateConstrainedHtmlDialog( |
| 153 profile, html_delegate, wrapper); |
| 154 controller_->set_window(dialog_delegate->window()); |
| 152 } | 155 } |
| 153 | 156 |
| 154 RepostFormWarningUI::~RepostFormWarningUI() {} | 157 RepostFormWarningUI::~RepostFormWarningUI() {} |
| 155 | 158 |
| 156 void RepostFormWarningUI::OnDialogClosed(bool repost) { | 159 void RepostFormWarningUI::OnDialogClosed(bool repost) { |
| 160 controller_->set_window(NULL); |
| 157 if (repost) | 161 if (repost) |
| 158 controller_->Continue(); | 162 controller_->Continue(); |
| 159 else | 163 else |
| 160 controller_->Cancel(); | 164 controller_->Cancel(); |
| 161 delete this; | 165 delete this; |
| 162 } | 166 } |
| OLD | NEW |