| 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 // TODO: the ExtensionService should never be NULL, but in some cases it is, | 158 DCHECK(profile->GetExtensionService()); |
| 159 // see bug 73768. After it is resolved, the explicit test can go away. | 159 if (!profile->GetExtensionService()->IsInstalledApp(url)) |
| 160 ExtensionService* service = profile->GetExtensionService(); | |
| 161 if (!service || !service->IsInstalledApp(url)) | |
| 162 return; | 160 return; |
| 163 | 161 |
| 164 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, | 162 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, |
| 165 extension_misc::APP_LAUNCH_NTP_RECENTLY_CLOSED, | 163 extension_misc::APP_LAUNCH_NTP_RECENTLY_CLOSED, |
| 166 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 164 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
| 167 } | 165 } |
| 168 | 166 |
| 169 } // namespace | 167 } // namespace |
| 170 | 168 |
| 171 TabRestoreService::Tab::Tab() | 169 TabRestoreService::Tab::Tab() |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 // correctly write out the entries when Save is invoked (Save starts from | 1076 // correctly write out the entries when Save is invoked (Save starts from |
| 1079 // the front, not the end and we just added the entries to the end). | 1077 // the front, not the end and we just added the entries to the end). |
| 1080 entries_to_write_ = staging_entries_.size(); | 1078 entries_to_write_ = staging_entries_.size(); |
| 1081 | 1079 |
| 1082 PruneAndNotify(); | 1080 PruneAndNotify(); |
| 1083 } | 1081 } |
| 1084 | 1082 |
| 1085 Time TabRestoreService::TimeNow() const { | 1083 Time TabRestoreService::TimeNow() const { |
| 1086 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); | 1084 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); |
| 1087 } | 1085 } |
| OLD | NEW |