| 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 "content/browser/tab_contents/navigation_controller.h" | 5 #include "content/browser/tab_contents/navigation_controller.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_number_conversions.h" // Temporary | 9 #include "base/string_number_conversions.h" // Temporary |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/repost_form_warning_controller.h" |
| 13 #include "content/browser/browser_context.h" | 14 #include "content/browser/browser_context.h" |
| 14 #include "content/browser/browser_url_handler.h" | 15 #include "content/browser/browser_url_handler.h" |
| 15 #include "content/browser/child_process_security_policy.h" | 16 #include "content/browser/child_process_security_policy.h" |
| 16 #include "content/browser/in_process_webkit/session_storage_namespace.h" | 17 #include "content/browser/in_process_webkit/session_storage_namespace.h" |
| 17 #include "content/browser/renderer_host/render_view_host.h" // Temporary | 18 #include "content/browser/renderer_host/render_view_host.h" // Temporary |
| 18 #include "content/browser/site_instance.h" | 19 #include "content/browser/site_instance.h" |
| 19 #include "content/browser/tab_contents/interstitial_page.h" | 20 #include "content/browser/tab_contents/interstitial_page.h" |
| 20 #include "content/browser/tab_contents/navigation_details.h" | 21 #include "content/browser/tab_contents/navigation_details.h" |
| 21 #include "content/browser/tab_contents/navigation_entry.h" | 22 #include "content/browser/tab_contents/navigation_entry.h" |
| 22 #include "content/browser/tab_contents/tab_contents.h" | 23 #include "content/browser/tab_contents/tab_contents.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // The user is asking to reload a page with POST data. Prompt to make sure | 186 // The user is asking to reload a page with POST data. Prompt to make sure |
| 186 // they really want to do this. If they do, the dialog will call us back | 187 // they really want to do this. If they do, the dialog will call us back |
| 187 // with check_for_repost = false. | 188 // with check_for_repost = false. |
| 188 content::NotificationService::current()->Notify( | 189 content::NotificationService::current()->Notify( |
| 189 content::NOTIFICATION_REPOST_WARNING_SHOWN, | 190 content::NOTIFICATION_REPOST_WARNING_SHOWN, |
| 190 content::Source<NavigationController>(this), | 191 content::Source<NavigationController>(this), |
| 191 content::NotificationService::NoDetails()); | 192 content::NotificationService::NoDetails()); |
| 192 | 193 |
| 193 pending_reload_ = reload_type; | 194 pending_reload_ = reload_type; |
| 194 tab_contents_->Activate(); | 195 tab_contents_->Activate(); |
| 195 tab_contents_->delegate()->ShowRepostFormWarningDialog(tab_contents_); | 196 tab_contents_->delegate()->ShowTabModalDialog( |
| 197 new RepostFormWarningController(tab_contents_), tab_contents_); |
| 196 } else { | 198 } else { |
| 197 DiscardNonCommittedEntriesInternal(); | 199 DiscardNonCommittedEntriesInternal(); |
| 198 | 200 |
| 199 pending_entry_index_ = current_index; | 201 pending_entry_index_ = current_index; |
| 200 entries_[pending_entry_index_]->set_transition_type( | 202 entries_[pending_entry_index_]->set_transition_type( |
| 201 content::PAGE_TRANSITION_RELOAD); | 203 content::PAGE_TRANSITION_RELOAD); |
| 202 NavigateToPendingEntry(reload_type); | 204 NavigateToPendingEntry(reload_type); |
| 203 } | 205 } |
| 204 } | 206 } |
| 205 | 207 |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 for (int i = 0; i < max_index; i++) { | 1285 for (int i = 0; i < max_index; i++) { |
| 1284 // When cloning a tab, copy all entries except interstitial pages | 1286 // When cloning a tab, copy all entries except interstitial pages |
| 1285 if (source.entries_[i].get()->page_type() != | 1287 if (source.entries_[i].get()->page_type() != |
| 1286 content::PAGE_TYPE_INTERSTITIAL) { | 1288 content::PAGE_TYPE_INTERSTITIAL) { |
| 1287 entries_.insert(entries_.begin() + insert_index++, | 1289 entries_.insert(entries_.begin() + insert_index++, |
| 1288 linked_ptr<NavigationEntry>( | 1290 linked_ptr<NavigationEntry>( |
| 1289 new NavigationEntry(*source.entries_[i]))); | 1291 new NavigationEntry(*source.entries_[i]))); |
| 1290 } | 1292 } |
| 1291 } | 1293 } |
| 1292 } | 1294 } |
| OLD | NEW |