OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVAL_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVAL_CONTROLLER_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 #import "base/ios/block_types.h" |
| 11 #include "components/browsing_data/core/browsing_data_utils.h" |
| 12 |
| 13 @class BrowserViewController; |
| 14 |
| 15 namespace ios { |
| 16 class ChromeBrowserState; |
| 17 } // namespace ios |
| 18 |
| 19 // A protocol required by delegates of the BrowsingDataRemovalController. |
| 20 @protocol BrowsingDataRemovalControllerDelegate |
| 21 @required |
| 22 // Removes files received from other applications by |browserState|. |
| 23 // |completionHandler| is called when the files have been removed. |
| 24 - (void)removeExternalFilesForBrowserState: |
| 25 (ios::ChromeBrowserState*)browserState |
| 26 completionHandler:(ProceduralBlock)completionHandler; |
| 27 // TODO(crbug.com/543213): Add a method here to inform the delegate when there |
| 28 // are no pending removal operations associated with a BrowserState. |
| 29 @end |
| 30 |
| 31 // This class is responsible for removing browsing data associated with a |
| 32 // ChromeBrowserState. |
| 33 @interface BrowsingDataRemovalController : NSObject |
| 34 |
| 35 - (instancetype)initWithDelegate: |
| 36 (id<BrowsingDataRemovalControllerDelegate>)delegate |
| 37 NS_DESIGNATED_INITIALIZER; |
| 38 |
| 39 - (instancetype)init NS_UNAVAILABLE; |
| 40 |
| 41 // Removes browsing data from |browserState| for datatypes in |mask|. |
| 42 // |mask| is obtained from IOSChromeBrowsingDataRemover::RemoveDataMask. |
| 43 // |browserState| cannot be null and must not be off the record. |
| 44 - (void)removeBrowsingDataFromBrowserState: |
| 45 (ios::ChromeBrowserState*)browserState |
| 46 mask:(int)mask |
| 47 timePeriod:(browsing_data::TimePeriod)timePeriod |
| 48 completionHandler:(ProceduralBlock)completionHandler; |
| 49 |
| 50 // Removes browsing data that iOS has associated with |browserState| and which |
| 51 // is not removed when the |browserState| is destroyed. |
| 52 // |mask| is obtained from IOSChromeBrowsingDataRemover::RemoveDataMask |
| 53 // |browserState| cannot be null. |completionHandler| is called when this |
| 54 // operation finishes. This method finishes removal of the browsing data even if |
| 55 // |browserState| is destroyed after this method call. |
| 56 - (void)removeIOSSpecificIncognitoBrowsingDataFromBrowserState: |
| 57 (ios::ChromeBrowserState*)browserState |
| 58 mask:(int)mask |
| 59 completionHandler: |
| 60 (ProceduralBlock) |
| 61 completionHandler; |
| 62 |
| 63 // Called when |browserState| is destroyed. |
| 64 - (void)browserStateDestroyed:(ios::ChromeBrowserState*)browserState; |
| 65 |
| 66 // Returns YES if browsing data for |browserState| is still being cleared. |
| 67 - (BOOL)hasPendingRemovalOperations:(ios::ChromeBrowserState*)browserState; |
| 68 |
| 69 @end |
| 70 |
| 71 #endif // IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVAL_CONTROLLER_H_ |
OLD | NEW |