Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sessions/session_restore.h" | 5 #include "chrome/browser/sessions/session_restore.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 646 bool schedule_load) { | 646 bool schedule_load) { |
| 647 DCHECK(!tab.navigations.empty()); | 647 DCHECK(!tab.navigations.empty()); |
| 648 int selected_index = tab.current_navigation_index; | 648 int selected_index = tab.current_navigation_index; |
| 649 selected_index = std::max( | 649 selected_index = std::max( |
| 650 0, | 650 0, |
| 651 std::min(selected_index, | 651 std::min(selected_index, |
| 652 static_cast<int>(tab.navigations.size() - 1))); | 652 static_cast<int>(tab.navigations.size() - 1))); |
| 653 | 653 |
| 654 // Record an app launch, if applicable. | 654 // Record an app launch, if applicable. |
| 655 GURL url = tab.navigations.at(tab.current_navigation_index).virtual_url(); | 655 GURL url = tab.navigations.at(tab.current_navigation_index).virtual_url(); |
| 656 #if defined(OS_CHROMEOS) | |
| 657 if (browser->profile()->GetExtensionService() && | |
| 658 browser->profile()->GetExtensionService()->IsInstalledApp(url)) { | |
| 659 #else | |
| 656 DCHECK(browser->profile()->GetExtensionService()); | 660 DCHECK(browser->profile()->GetExtensionService()); |
| 657 if (browser->profile()->GetExtensionService()->IsInstalledApp(url)) { | 661 if (browser->profile()->GetExtensionService()->IsInstalledApp(url)) { |
| 662 #endif | |
|
stevenjb
2011/03/16 22:52:55
Maybe only do the DCHECK for non OS_CHROMEOS and m
zel
2011/03/17 01:00:30
This solves the crash that affects our debugging,
stevenjb
2011/03/17 01:30:37
I meant to suggest leaving the DCHECK in for non-c
| |
| 658 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, | 663 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, |
| 659 extension_misc::APP_LAUNCH_SESSION_RESTORE, | 664 extension_misc::APP_LAUNCH_SESSION_RESTORE, |
| 660 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 665 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
| 661 } | 666 } |
| 662 | 667 |
| 663 TabContents* tab_contents = | 668 TabContents* tab_contents = |
| 664 browser->AddRestoredTab(tab.navigations, | 669 browser->AddRestoredTab(tab.navigations, |
| 665 tab_index, | 670 tab_index, |
| 666 selected_index, | 671 selected_index, |
| 667 tab.extension_app_id, | 672 tab.extension_app_id, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 836 Browser* SessionRestore::RestoreSessionSynchronously( | 841 Browser* SessionRestore::RestoreSessionSynchronously( |
| 837 Profile* profile, | 842 Profile* profile, |
| 838 const std::vector<GURL>& urls_to_open) { | 843 const std::vector<GURL>& urls_to_open) { |
| 839 return Restore(profile, NULL, true, false, true, urls_to_open); | 844 return Restore(profile, NULL, true, false, true, urls_to_open); |
| 840 } | 845 } |
| 841 | 846 |
| 842 // static | 847 // static |
| 843 bool SessionRestore::IsRestoring() { | 848 bool SessionRestore::IsRestoring() { |
| 844 return restoring; | 849 return restoring; |
| 845 } | 850 } |
| OLD | NEW |