| 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 | 628 |
| 629 void Browser::OnWindowClosing() { | 629 void Browser::OnWindowClosing() { |
| 630 if (!ShouldCloseWindow()) | 630 if (!ShouldCloseWindow()) |
| 631 return; | 631 return; |
| 632 | 632 |
| 633 // Application should shutdown on last window close if the user is explicitly | 633 // Application should shutdown on last window close if the user is explicitly |
| 634 // trying to quit, or if there is nothing keeping the browser alive (such as | 634 // trying to quit, or if there is nothing keeping the browser alive (such as |
| 635 // AppController on the Mac, or BackgroundContentsService for background | 635 // AppController on the Mac, or BackgroundContentsService for background |
| 636 // pages). | 636 // pages). |
| 637 bool should_quit_if_last_browser = | 637 bool should_quit_if_last_browser = |
| 638 browser_shutdown::IsTryingToQuit() || !browser::WillKeepAlive(); | 638 browser_shutdown::IsTryingToQuit() || !chrome::WillKeepAlive(); |
| 639 | 639 |
| 640 if (should_quit_if_last_browser && BrowserList::size() == 1) | 640 if (should_quit_if_last_browser && BrowserList::size() == 1) |
| 641 browser_shutdown::OnShutdownStarting(browser_shutdown::WINDOW_CLOSE); | 641 browser_shutdown::OnShutdownStarting(browser_shutdown::WINDOW_CLOSE); |
| 642 | 642 |
| 643 // Don't use GetForProfileIfExisting here, we want to force creation of the | 643 // Don't use GetForProfileIfExisting here, we want to force creation of the |
| 644 // session service so that user can restore what was open. | 644 // session service so that user can restore what was open. |
| 645 SessionService* session_service = | 645 SessionService* session_service = |
| 646 SessionServiceFactory::GetForProfile(profile()); | 646 SessionServiceFactory::GetForProfile(profile()); |
| 647 if (session_service) | 647 if (session_service) |
| 648 session_service->WindowClosing(session_id()); | 648 session_service->WindowClosing(session_id()); |
| (...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 if (contents && !allow_js_access) { | 2332 if (contents && !allow_js_access) { |
| 2333 contents->web_contents()->GetController().LoadURL( | 2333 contents->web_contents()->GetController().LoadURL( |
| 2334 target_url, | 2334 target_url, |
| 2335 content::Referrer(), | 2335 content::Referrer(), |
| 2336 content::PAGE_TRANSITION_LINK, | 2336 content::PAGE_TRANSITION_LINK, |
| 2337 std::string()); // No extra headers. | 2337 std::string()); // No extra headers. |
| 2338 } | 2338 } |
| 2339 | 2339 |
| 2340 return contents != NULL; | 2340 return contents != NULL; |
| 2341 } | 2341 } |
| OLD | NEW |