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()) { | |
sky
2014/02/18 21:24:00
nit: no {}
benjhayden
2014/02/18 22:11:34
Done.
| |
702 fast_unload_controller_->CancelWindowClose(); | |
703 } else { | |
704 unload_controller_->CancelWindowClose(); | |
705 } | |
698 } | 706 } |
699 | 707 |
700 Browser::DownloadClosePreventionType Browser::OkToCloseWithInProgressDownloads( | 708 Browser::DownloadClosePreventionType Browser::OkToCloseWithInProgressDownloads( |
701 int* num_downloads_blocking) const { | 709 int* num_downloads_blocking) const { |
702 DCHECK(num_downloads_blocking); | 710 DCHECK(num_downloads_blocking); |
703 *num_downloads_blocking = 0; | 711 *num_downloads_blocking = 0; |
704 | 712 |
705 // If we're not running a full browser process with a profile manager | 713 // If we're not running a full browser process with a profile manager |
706 // (testing), it's ok to close the browser. | 714 // (testing), it's ok to close the browser. |
707 if (!g_browser_process->profile_manager()) | 715 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) { | 2320 if (contents && !allow_js_access) { |
2313 contents->web_contents()->GetController().LoadURL( | 2321 contents->web_contents()->GetController().LoadURL( |
2314 target_url, | 2322 target_url, |
2315 content::Referrer(), | 2323 content::Referrer(), |
2316 content::PAGE_TRANSITION_LINK, | 2324 content::PAGE_TRANSITION_LINK, |
2317 std::string()); // No extra headers. | 2325 std::string()); // No extra headers. |
2318 } | 2326 } |
2319 | 2327 |
2320 return contents != NULL; | 2328 return contents != NULL; |
2321 } | 2329 } |
OLD | NEW |