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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 | 609 |
610 // Application should shutdown on last window close if the user is explicitly | 610 // Application should shutdown on last window close if the user is explicitly |
611 // trying to quit, or if there is nothing keeping the browser alive (such as | 611 // trying to quit, or if there is nothing keeping the browser alive (such as |
612 // AppController on the Mac, or BackgroundContentsService for background | 612 // AppController on the Mac, or BackgroundContentsService for background |
613 // pages). | 613 // pages). |
614 bool should_quit_if_last_browser = | 614 bool should_quit_if_last_browser = |
615 browser_shutdown::IsTryingToQuit() || !chrome::WillKeepAlive(); | 615 browser_shutdown::IsTryingToQuit() || !chrome::WillKeepAlive(); |
616 | 616 |
617 if (should_quit_if_last_browser && | 617 if (should_quit_if_last_browser && |
618 BrowserList::GetInstance(host_desktop_type_)->size() == 1) { | 618 BrowserList::GetInstance(host_desktop_type_)->size() == 1) { |
619 #if defined(OS_WIN) && defined(USE_AURA) | |
620 // On Windows 8 browser windows could be open in ASH and in the desktop. We | |
621 // should not start the shutdown process if browser windows are open in the | |
622 // other environment. | |
623 chrome::HostDesktopType other_desktop = | |
624 (host_desktop_type_ == chrome::HOST_DESKTOP_TYPE_NATIVE ? | |
625 chrome::HOST_DESKTOP_TYPE_ASH : chrome::HOST_DESKTOP_TYPE_NATIVE); | |
626 if (BrowserList::GetInstance(other_desktop)->empty()) | |
cpu_(ooo_6.6-7.5)
2013/04/17 21:37:44
should this change go into chrome/browser/lifetime
ananta
2013/04/17 22:03:06
Done. Added a function ShouldStartShutdown in appl
| |
627 #endif | |
619 browser_shutdown::OnShutdownStarting(browser_shutdown::WINDOW_CLOSE); | 628 browser_shutdown::OnShutdownStarting(browser_shutdown::WINDOW_CLOSE); |
620 } | 629 } |
621 | 630 |
622 // Don't use GetForProfileIfExisting here, we want to force creation of the | 631 // Don't use GetForProfileIfExisting here, we want to force creation of the |
623 // session service so that user can restore what was open. | 632 // session service so that user can restore what was open. |
624 SessionService* session_service = | 633 SessionService* session_service = |
625 SessionServiceFactory::GetForProfile(profile()); | 634 SessionServiceFactory::GetForProfile(profile()); |
626 if (session_service) | 635 if (session_service) |
627 session_service->WindowClosing(session_id()); | 636 session_service->WindowClosing(session_id()); |
628 | 637 |
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2255 if (contents && !allow_js_access) { | 2264 if (contents && !allow_js_access) { |
2256 contents->web_contents()->GetController().LoadURL( | 2265 contents->web_contents()->GetController().LoadURL( |
2257 target_url, | 2266 target_url, |
2258 content::Referrer(), | 2267 content::Referrer(), |
2259 content::PAGE_TRANSITION_LINK, | 2268 content::PAGE_TRANSITION_LINK, |
2260 std::string()); // No extra headers. | 2269 std::string()); // No extra headers. |
2261 } | 2270 } |
2262 | 2271 |
2263 return contents != NULL; | 2272 return contents != NULL; |
2264 } | 2273 } |
OLD | NEW |