1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SPECIAL_STORAGE_POLICY_H_
6 #define CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SPECIAL_STORAGE_POLICY_H_
11 #include "chrome/browser/extensions/extension_special_storage_policy.h"
14 // This class is the same as MockSpecialStoragePolicy (in
15 // content/public/test/mock_special_storage_policy.h), but it inherits
16 // ExtensionSpecialStoragePolicy instead of storage::SpecialStoragePolicy.
17 class MockExtensionSpecialStoragePolicy
: public ExtensionSpecialStoragePolicy
{
19 MockExtensionSpecialStoragePolicy();
21 // storage::SpecialStoragePolicy:
22 bool IsStorageProtected(const GURL
& origin
) override
;
23 bool IsStorageUnlimited(const GURL
& origin
) override
;
24 bool IsStorageSessionOnly(const GURL
& origin
) override
;
25 bool CanQueryDiskSize(const GURL
& origin
) override
;
26 bool HasSessionOnlyOrigins() override
;
28 void AddProtected(const GURL
& origin
) {
29 protected_
.insert(origin
);
33 ~MockExtensionSpecialStoragePolicy() override
;
35 std::set
<GURL
> protected_
;
37 DISALLOW_COPY_AND_ASSIGN(MockExtensionSpecialStoragePolicy
);
40 #endif // CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SPECIAL_STORAGE_POLICY_H_