OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "ios/chrome/app/startup/background_upload_alert.h" | 5 #include "ios/chrome/app/startup/background_upload_alert.h" |
6 | 6 |
7 #include "ios/chrome/browser/experimental_flags.h" | 7 #include "ios/chrome/browser/experimental_flags.h" |
8 | 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 10 #error "This file requires ARC support." |
| 11 #endif |
| 12 |
9 @implementation BackgroundUploadAlert | 13 @implementation BackgroundUploadAlert |
10 | 14 |
11 + (void)setupBackgroundUploadAlert { | 15 + (void)setupBackgroundUploadAlert { |
12 if (experimental_flags::IsAlertOnBackgroundUploadEnabled()) { | 16 if (experimental_flags::IsAlertOnBackgroundUploadEnabled()) { |
13 if ([UIApplication instancesRespondToSelector: | 17 if ([UIApplication instancesRespondToSelector: |
14 @selector(registerUserNotificationSettings:)]) { | 18 @selector(registerUserNotificationSettings:)]) { |
15 [[UIApplication sharedApplication] | 19 [[UIApplication sharedApplication] |
16 registerUserNotificationSettings: | 20 registerUserNotificationSettings: |
17 [UIUserNotificationSettings | 21 [UIUserNotificationSettings |
18 settingsForTypes:UIUserNotificationTypeAlert | | 22 settingsForTypes:UIUserNotificationTypeAlert | |
19 UIUserNotificationTypeBadge | | 23 UIUserNotificationTypeBadge | |
20 UIUserNotificationTypeSound | 24 UIUserNotificationTypeSound |
21 categories:nil]]; | 25 categories:nil]]; |
22 } | 26 } |
23 } | 27 } |
24 } | 28 } |
25 | 29 |
26 @end | 30 @end |
OLD | NEW |