| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 return; | 688 return; |
| 689 } | 689 } |
| 690 | 690 |
| 691 // Sets the confirmation state to NOT_PROMPTED so that if the user tries to | 691 // Sets the confirmation state to NOT_PROMPTED so that if the user tries to |
| 692 // close again we'll show the warning again. | 692 // close again we'll show the warning again. |
| 693 cancel_download_confirmation_state_ = NOT_PROMPTED; | 693 cancel_download_confirmation_state_ = NOT_PROMPTED; |
| 694 | 694 |
| 695 // Show the download page so the user can figure-out what downloads are still | 695 // Show the download page so the user can figure-out what downloads are still |
| 696 // in-progress. | 696 // in-progress. |
| 697 chrome::ShowDownloads(this); | 697 chrome::ShowDownloads(this); |
| 698 |
| 699 // Reset UnloadController::is_attempting_to_close_browser_ so that we don't |
| 700 // prompt every time any tab is closed. http://crbug.com/305516 |
| 701 if (IsFastTabUnloadEnabled()) |
| 702 fast_unload_controller_->CancelWindowClose(); |
| 703 else |
| 704 unload_controller_->CancelWindowClose(); |
| 698 } | 705 } |
| 699 | 706 |
| 700 Browser::DownloadClosePreventionType Browser::OkToCloseWithInProgressDownloads( | 707 Browser::DownloadClosePreventionType Browser::OkToCloseWithInProgressDownloads( |
| 701 int* num_downloads_blocking) const { | 708 int* num_downloads_blocking) const { |
| 702 DCHECK(num_downloads_blocking); | 709 DCHECK(num_downloads_blocking); |
| 703 *num_downloads_blocking = 0; | 710 *num_downloads_blocking = 0; |
| 704 | 711 |
| 705 // If we're not running a full browser process with a profile manager | 712 // If we're not running a full browser process with a profile manager |
| 706 // (testing), it's ok to close the browser. | 713 // (testing), it's ok to close the browser. |
| 707 if (!g_browser_process->profile_manager()) | 714 if (!g_browser_process->profile_manager()) |
| (...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2312 if (contents && !allow_js_access) { | 2319 if (contents && !allow_js_access) { |
| 2313 contents->web_contents()->GetController().LoadURL( | 2320 contents->web_contents()->GetController().LoadURL( |
| 2314 target_url, | 2321 target_url, |
| 2315 content::Referrer(), | 2322 content::Referrer(), |
| 2316 content::PAGE_TRANSITION_LINK, | 2323 content::PAGE_TRANSITION_LINK, |
| 2317 std::string()); // No extra headers. | 2324 std::string()); // No extra headers. |
| 2318 } | 2325 } |
| 2319 | 2326 |
| 2320 return contents != NULL; | 2327 return contents != NULL; |
| 2321 } | 2328 } |
| OLD | NEW |