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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 Browser* browser, | 677 Browser* browser, |
678 bool schedule_load) { | 678 bool schedule_load) { |
679 DCHECK(!tab.navigations.empty()); | 679 DCHECK(!tab.navigations.empty()); |
680 int selected_index = tab.current_navigation_index; | 680 int selected_index = tab.current_navigation_index; |
681 selected_index = std::max( | 681 selected_index = std::max( |
682 0, | 682 0, |
683 std::min(selected_index, | 683 std::min(selected_index, |
684 static_cast<int>(tab.navigations.size() - 1))); | 684 static_cast<int>(tab.navigations.size() - 1))); |
685 | 685 |
686 // Record an app launch, if applicable. | 686 // Record an app launch, if applicable. |
687 GURL url = tab.navigations.at(tab.current_navigation_index).virtual_url(); | 687 GURL url = tab.navigations.at(selected_index).virtual_url(); |
688 if ( | 688 if ( |
689 #if defined(OS_CHROMEOS) | 689 #if defined(OS_CHROMEOS) |
690 browser->profile()->GetExtensionService() && | 690 browser->profile()->GetExtensionService() && |
691 #endif | 691 #endif |
692 browser->profile()->GetExtensionService()->IsInstalledApp(url)) { | 692 browser->profile()->GetExtensionService()->IsInstalledApp(url)) { |
693 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, | 693 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, |
694 extension_misc::APP_LAUNCH_SESSION_RESTORE, | 694 extension_misc::APP_LAUNCH_SESSION_RESTORE, |
695 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 695 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
696 } | 696 } |
697 | 697 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 std::vector<GURL> gurls; | 854 std::vector<GURL> gurls; |
855 SessionRestoreImpl restorer(profile, | 855 SessionRestoreImpl restorer(profile, |
856 static_cast<Browser*>(NULL), true, false, true, gurls); | 856 static_cast<Browser*>(NULL), true, false, true, gurls); |
857 restorer.RestoreForeignTab(tab); | 857 restorer.RestoreForeignTab(tab); |
858 } | 858 } |
859 | 859 |
860 // static | 860 // static |
861 bool SessionRestore::IsRestoring() { | 861 bool SessionRestore::IsRestoring() { |
862 return restoring; | 862 return restoring; |
863 } | 863 } |
OLD | NEW |