Roll src/third_party/skia a6ae14e:85693c1
[chromium-blink-merge.git] / ios / web / browsing_data_partition_impl.h
blob21b2ee452b049670a1c8c431258a8c18d5034f8e
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_BROWSING_DATA_PARTITION_IMPL_H_
6 #define IOS_WEB_BROWSING_DATA_PARTITION_IMPL_H_
8 #import "base/mac/scoped_nsobject.h"
9 #include "base/macros.h"
10 #include "base/supports_user_data.h"
11 #include "ios/web/active_state_manager_impl.h"
12 #include "ios/web/public/browsing_data_partition.h"
14 @class CRWBrowsingDataStore;
16 namespace web {
18 class ActiveStateManagerImpl;
19 class BrowserState;
21 // Concrete subclass of web::BrowsingDataPartition. Observes
22 // ActiveStateManagerImpl::Observer methods to trigger stash/restore operations
23 // on the underlying CRWBrowsingDataStore.
24 class BrowsingDataPartitionImpl : public BrowsingDataPartition,
25 public base::SupportsUserData::Data,
26 public web::ActiveStateManagerImpl::Observer {
27 public:
28 explicit BrowsingDataPartitionImpl(BrowserState* browser_state);
29 ~BrowsingDataPartitionImpl() override;
31 // BrowsingDataPartition implementation.
32 CRWBrowsingDataStore* GetBrowsingDataStore() override;
34 // ActiveStateManagerImpl::Observer implementation.
35 void OnActive() override;
36 void OnInactive() override;
37 void WillBeDestroyed() override;
39 private:
40 BrowserState* browser_state_; // weak, owns this object.
41 // The browsing data store backing this object.
42 base::scoped_nsobject<CRWBrowsingDataStore> browsing_data_store_;
43 // Weak pointer to the associated active state manager.
44 ActiveStateManagerImpl* active_state_manager_;
46 DISALLOW_COPY_AND_ASSIGN(BrowsingDataPartitionImpl);
49 } // namespace web
51 #endif // IOS_WEB_BROWSING_DATA_PARTITION_IMPL_H_