| 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 SessionServiceFactory::GetForProfile(profile_); | 456 SessionServiceFactory::GetForProfile(profile_); |
| 457 if (session_service) | 457 if (session_service) |
| 458 session_service->WindowClosed(session_id_); | 458 session_service->WindowClosed(session_id_); |
| 459 | 459 |
| 460 TabRestoreService* tab_restore_service = | 460 TabRestoreService* tab_restore_service = |
| 461 TabRestoreServiceFactory::GetForProfile(profile()); | 461 TabRestoreServiceFactory::GetForProfile(profile()); |
| 462 if (tab_restore_service) | 462 if (tab_restore_service) |
| 463 tab_restore_service->BrowserClosed(tab_restore_service_delegate()); | 463 tab_restore_service->BrowserClosed(tab_restore_service_delegate()); |
| 464 | 464 |
| 465 #if !defined(OS_MACOSX) | 465 #if !defined(OS_MACOSX) |
| 466 if (!chrome::GetBrowserCount(profile_)) { | 466 if (!chrome::GetTotalBrowserCountForProfile(profile_)) { |
| 467 // We're the last browser window with this profile. We need to nuke the | 467 // We're the last browser window with this profile. We need to nuke the |
| 468 // TabRestoreService, which will start the shutdown of the | 468 // TabRestoreService, which will start the shutdown of the |
| 469 // NavigationControllers and allow for proper shutdown. If we don't do this | 469 // NavigationControllers and allow for proper shutdown. If we don't do this |
| 470 // chrome won't shutdown cleanly, and may end up crashing when some | 470 // chrome won't shutdown cleanly, and may end up crashing when some |
| 471 // thread tries to use the IO thread (or another thread) that is no longer | 471 // thread tries to use the IO thread (or another thread) that is no longer |
| 472 // valid. | 472 // valid. |
| 473 // This isn't a valid assumption for Mac OS, as it stays running after | 473 // This isn't a valid assumption for Mac OS, as it stays running after |
| 474 // the last browser has closed. The Mac equivalent is in its app | 474 // the last browser has closed. The Mac equivalent is in its app |
| 475 // controller. | 475 // controller. |
| 476 TabRestoreServiceFactory::ResetForProfile(profile_); | 476 TabRestoreServiceFactory::ResetForProfile(profile_); |
| (...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2249 if (contents && !allow_js_access) { | 2249 if (contents && !allow_js_access) { |
| 2250 contents->web_contents()->GetController().LoadURL( | 2250 contents->web_contents()->GetController().LoadURL( |
| 2251 target_url, | 2251 target_url, |
| 2252 content::Referrer(), | 2252 content::Referrer(), |
| 2253 content::PAGE_TRANSITION_LINK, | 2253 content::PAGE_TRANSITION_LINK, |
| 2254 std::string()); // No extra headers. | 2254 std::string()); // No extra headers. |
| 2255 } | 2255 } |
| 2256 | 2256 |
| 2257 return contents != NULL; | 2257 return contents != NULL; |
| 2258 } | 2258 } |
| OLD | NEW |