OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import "ios/chrome/app/application_delegate/background_activity.h" | 5 #import "ios/chrome/app/application_delegate/background_activity.h" |
6 | 6 |
7 #import "base/ios/weak_nsobject.h" | |
8 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
9 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
10 #include "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
11 #include "base/time/time.h" | 10 #include "base/time/time.h" |
12 #import "ios/chrome/app/application_delegate/browser_launcher.h" | 11 #import "ios/chrome/app/application_delegate/browser_launcher.h" |
13 #import "ios/chrome/app/application_delegate/metrics_mediator.h" | 12 #import "ios/chrome/app/application_delegate/metrics_mediator.h" |
14 #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h" | 13 #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h" |
15 #include "ios/chrome/browser/metrics/first_user_action_recorder.h" | 14 #include "ios/chrome/browser/metrics/first_user_action_recorder.h" |
16 #import "ios/chrome/browser/metrics/previous_session_info.h" | 15 #import "ios/chrome/browser/metrics/previous_session_info.h" |
17 #include "url/gurl.h" | 16 #include "url/gurl.h" |
18 | 17 |
sdefresne
2017/01/17 14:48:29
Do you forgot to add ARC guards here?
stkhapugin
2017/01/17 14:53:55
Done.
| |
19 namespace { | 18 namespace { |
20 // Key of the UMA Startup.BackgroundFetchTimeInterval histogram. | 19 // Key of the UMA Startup.BackgroundFetchTimeInterval histogram. |
21 const char* const kUMAMobileBackgroundFetchTimeInterval = | 20 const char* const kUMAMobileBackgroundFetchTimeInterval = |
22 "Startup.BackgroundFetchTimeInterval"; | 21 "Startup.BackgroundFetchTimeInterval"; |
23 // Key in the UserDefaults to store the date/time that the application was last | 22 // Key in the UserDefaults to store the date/time that the application was last |
24 // launched for a background fetch. | 23 // launched for a background fetch. |
25 NSString* const kLastBackgroundFetch = @"LastBackgroundFetch"; | 24 NSString* const kLastBackgroundFetch = @"LastBackgroundFetch"; |
26 } // namespace | 25 } // namespace |
27 | 26 |
28 @implementation BackgroundActivity | 27 @implementation BackgroundActivity |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 completionHandler(); | 84 completionHandler(); |
86 } | 85 } |
87 } | 86 } |
88 | 87 |
89 + (void)foregroundStarted { | 88 + (void)foregroundStarted { |
90 [[NSUserDefaults standardUserDefaults] | 89 [[NSUserDefaults standardUserDefaults] |
91 removeObjectForKey:kLastBackgroundFetch]; | 90 removeObjectForKey:kLastBackgroundFetch]; |
92 } | 91 } |
93 | 92 |
94 @end | 93 @end |
OLD | NEW |