Infobar material design refresh: bg color
[chromium-blink-merge.git] / ios / web / browsing_data_partition_impl.h
blobc8d357ff4f49f1f15bb055814ac42cf8823d0461
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/public/active_state_manager.h"
12 #include "ios/web/public/browsing_data_partition.h"
14 @class CRWBrowsingDataStore;
16 namespace web {
18 class BrowserState;
20 // Concrete subclass of web::BrowsingDataPartition. Observes
21 // ActiveStateManager::Observer methods to trigger stash/restore operations
22 // on the underlying CRWBrowsingDataStore.
23 class BrowsingDataPartitionImpl : public BrowsingDataPartition,
24 public base::SupportsUserData::Data,
25 public web::ActiveStateManager::Observer {
26 public:
27 explicit BrowsingDataPartitionImpl(BrowserState* browser_state);
28 ~BrowsingDataPartitionImpl() override;
30 // BrowsingDataPartition implementation.
31 CRWBrowsingDataStore* GetBrowsingDataStore() override;
33 // ActiveStateManager::Observer implementation.
34 void OnActive() override;
35 void OnInactive() override;
36 void WillBeDestroyed() override;
38 private:
39 BrowserState* browser_state_; // weak, owns this object.
40 // The browsing data store backing this object.
41 base::scoped_nsobject<CRWBrowsingDataStore> browsing_data_store_;
42 // Weak pointer to the associated active state manager.
43 ActiveStateManager* active_state_manager_;
45 DISALLOW_COPY_AND_ASSIGN(BrowsingDataPartitionImpl);
48 } // namespace web
50 #endif // IOS_WEB_BROWSING_DATA_PARTITION_IMPL_H_