| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_restore_service.h" | 5 #include "chrome/browser/sessions/tab_restore_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 return; | 148 return; |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| 155 void RecordAppLaunch(Browser* browser, const TabRestoreService::Tab& tab) { | 155 void RecordAppLaunch(Browser* browser, const TabRestoreService::Tab& tab) { |
| 156 GURL url = tab.navigations.at(tab.current_navigation_index).virtual_url(); | 156 GURL url = tab.navigations.at(tab.current_navigation_index).virtual_url(); |
| 157 Profile* profile = browser->profile(); | 157 Profile* profile = browser->profile(); |
| 158 if (!profile->GetExtensionService()->IsInstalledApp(url)) | 158 // TODO: the ExtensionService should never be NULL, but in some cases it is, |
| 159 // see bug 73768. After it is resolved, the explicit test can go away. |
| 160 ExtensionService* service = profile->GetExtensionService(); |
| 161 if (!service || !service->IsInstalledApp(url)) |
| 159 return; | 162 return; |
| 160 | 163 |
| 161 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, | 164 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, |
| 162 extension_misc::APP_LAUNCH_NTP_RECENTLY_CLOSED, | 165 extension_misc::APP_LAUNCH_NTP_RECENTLY_CLOSED, |
| 163 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 166 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
| 164 } | 167 } |
| 165 | 168 |
| 166 } // namespace | 169 } // namespace |
| 167 | 170 |
| 168 TabRestoreService::Tab::Tab() | 171 TabRestoreService::Tab::Tab() |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 // correctly write out the entries when Save is invoked (Save starts from | 1078 // correctly write out the entries when Save is invoked (Save starts from |
| 1076 // the front, not the end and we just added the entries to the end). | 1079 // the front, not the end and we just added the entries to the end). |
| 1077 entries_to_write_ = staging_entries_.size(); | 1080 entries_to_write_ = staging_entries_.size(); |
| 1078 | 1081 |
| 1079 PruneAndNotify(); | 1082 PruneAndNotify(); |
| 1080 } | 1083 } |
| 1081 | 1084 |
| 1082 Time TabRestoreService::TimeNow() const { | 1085 Time TabRestoreService::TimeNow() const { |
| 1083 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); | 1086 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); |
| 1084 } | 1087 } |
| OLD | NEW |