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.
5 #ifndef IOS_WEB_CRW_BROWSING_DATA_STORE_DELEGATE_H_
6 #define IOS_WEB_CRW_BROWSING_DATA_STORE_DELEGATE_H_
8 #import <Foundation/Foundation.h>
10 @
class CRWBrowsingDataStore
;
14 // The policy to pass back to the CRWBrowsingDataStore when the
15 // CRWBrowsingDataStore's mode wants to become |ACTIVE|.
16 typedef NS_ENUM(NSUInteger
, BrowsingDataStoreMakeActivePolicy
) {
17 // Adopt browsing data to the canonical path where web views store their
20 // Restore browsing data from the stash path. This is the default policy and
21 // is the same policy that is used if the delegate was not implemented.
25 // The policy to pass back to the CRWBrowsingDataStore when the
26 // CRWBrowsingDataStore's mode wants to become |INACTIVE|.
27 typedef NS_ENUM(NSUInteger
, BrowsingDataStoreMakeInactivePolicy
) {
28 // Delete browsing data created by the web views.
30 // Stash browsing data created by the web views. This is the default policy
31 // and is the same policy that is used if the delegate was not implemented.
37 // The CRWBrowsingDataStoreDelegate has methods that can override the default
38 // behavior of a CRWBrowsingDataStore when a mode change occurs.
39 @protocol CRWBrowsingDataStoreDelegate
<NSObject
>
41 // Called when a CRWBrowsingDataStore wants to change its mode to |ACTIVE|.
42 - (web::BrowsingDataStoreMakeActivePolicy
)
43 decideMakeActiveOperationPolicyForBrowsingDataStore
:
44 (CRWBrowsingDataStore
*)browsingDataStore
;
46 // Called when a CRWBrowsingDataStore wants to change its mode to |INACTIVE|.
47 - (web::BrowsingDataStoreMakeInactivePolicy
)
48 decideMakeInactiveOperationPolicyForBrowsingDataStore
:
49 (CRWBrowsingDataStore
*)browsingDataStore
;
53 #endif // IOS_WEB_CRW_BROWSING_DATA_STORE_DELEGATE_H_