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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 #include "ui/base/window_open_disposition.h" | 194 #include "ui/base/window_open_disposition.h" |
195 #include "ui/gfx/point.h" | 195 #include "ui/gfx/point.h" |
196 #include "ui/shell_dialogs/selected_file_info.h" | 196 #include "ui/shell_dialogs/selected_file_info.h" |
197 | 197 |
198 #if defined(OS_WIN) | 198 #if defined(OS_WIN) |
199 #include "base/win/metro.h" | 199 #include "base/win/metro.h" |
200 #include "chrome/browser/ssl/ssl_error_info.h" | 200 #include "chrome/browser/ssl/ssl_error_info.h" |
201 #include "chrome/browser/task_manager/task_manager.h" | 201 #include "chrome/browser/task_manager/task_manager.h" |
202 #include "chrome/browser/ui/view_ids.h" | 202 #include "chrome/browser/ui/view_ids.h" |
203 #include "components/autofill/core/browser/autofill_ie_toolbar_import_win.h" | 203 #include "components/autofill/core/browser/autofill_ie_toolbar_import_win.h" |
| 204 #include "components/browser_watcher/exit_funnel_win.h" |
204 #include "ui/base/touch/touch_device.h" | 205 #include "ui/base/touch/touch_device.h" |
205 #include "ui/base/win/shell.h" | 206 #include "ui/base/win/shell.h" |
206 #endif // OS_WIN | 207 #endif // OS_WIN |
207 | 208 |
208 #if defined(OS_CHROMEOS) | 209 #if defined(OS_CHROMEOS) |
209 #include "chrome/browser/chromeos/fileapi/external_file_url_util.h" | 210 #include "chrome/browser/chromeos/fileapi/external_file_url_util.h" |
210 #endif | 211 #endif |
211 | 212 |
212 #if defined(USE_ASH) | 213 #if defined(USE_ASH) |
213 #include "ash/ash_switches.h" | 214 #include "ash/ash_switches.h" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 if (!ShouldCloseWindow()) | 652 if (!ShouldCloseWindow()) |
652 return; | 653 return; |
653 | 654 |
654 // Application should shutdown on last window close if the user is explicitly | 655 // Application should shutdown on last window close if the user is explicitly |
655 // trying to quit, or if there is nothing keeping the browser alive (such as | 656 // trying to quit, or if there is nothing keeping the browser alive (such as |
656 // AppController on the Mac, or BackgroundContentsService for background | 657 // AppController on the Mac, or BackgroundContentsService for background |
657 // pages). | 658 // pages). |
658 bool should_quit_if_last_browser = | 659 bool should_quit_if_last_browser = |
659 browser_shutdown::IsTryingToQuit() || !chrome::WillKeepAlive(); | 660 browser_shutdown::IsTryingToQuit() || !chrome::WillKeepAlive(); |
660 | 661 |
661 if (should_quit_if_last_browser && chrome::ShouldStartShutdown(this)) | 662 if (should_quit_if_last_browser && chrome::ShouldStartShutdown(this)) { |
| 663 #if defined(OS_WIN) |
| 664 browser_watcher::ExitFunnel::RecordSingleEvent( |
| 665 chrome::kBrowserExitCodesRegistryPath, L"LastWindowClose"); |
| 666 #endif |
662 browser_shutdown::OnShutdownStarting(browser_shutdown::WINDOW_CLOSE); | 667 browser_shutdown::OnShutdownStarting(browser_shutdown::WINDOW_CLOSE); |
| 668 } |
663 | 669 |
664 // Don't use GetForProfileIfExisting here, we want to force creation of the | 670 // Don't use GetForProfileIfExisting here, we want to force creation of the |
665 // session service so that user can restore what was open. | 671 // session service so that user can restore what was open. |
666 SessionService* session_service = | 672 SessionService* session_service = |
667 SessionServiceFactory::GetForProfile(profile()); | 673 SessionServiceFactory::GetForProfile(profile()); |
668 if (session_service) | 674 if (session_service) |
669 session_service->WindowClosing(session_id()); | 675 session_service->WindowClosing(session_id()); |
670 | 676 |
671 TabRestoreService* tab_restore_service = | 677 TabRestoreService* tab_restore_service = |
672 TabRestoreServiceFactory::GetForProfile(profile()); | 678 TabRestoreServiceFactory::GetForProfile(profile()); |
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2526 if (contents && !allow_js_access) { | 2532 if (contents && !allow_js_access) { |
2527 contents->web_contents()->GetController().LoadURL( | 2533 contents->web_contents()->GetController().LoadURL( |
2528 target_url, | 2534 target_url, |
2529 content::Referrer(), | 2535 content::Referrer(), |
2530 ui::PAGE_TRANSITION_LINK, | 2536 ui::PAGE_TRANSITION_LINK, |
2531 std::string()); // No extra headers. | 2537 std::string()); // No extra headers. |
2532 } | 2538 } |
2533 | 2539 |
2534 return contents != NULL; | 2540 return contents != NULL; |
2535 } | 2541 } |
OLD | NEW |