NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / extensions / mock_extension_special_storage_policy.h
blob5fb958d40b426ee47eea63395eb96e23437bf1df
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_
8 #include <set>
9 #include <string>
11 #include "chrome/browser/extensions/extension_special_storage_policy.h"
12 #include "url/gurl.h"
14 // This class is the same as MockSpecialStoragePolicy (in
15 // webkit/browser/quota/mock_special_storage_policy.h), but it inherits
16 // ExtensionSpecialStoragePolicy instead of quota::SpecialStoragePolicy.
17 class MockExtensionSpecialStoragePolicy : public ExtensionSpecialStoragePolicy {
18 public:
19 MockExtensionSpecialStoragePolicy();
21 // quota::SpecialStoragePolicy:
22 virtual bool IsStorageProtected(const GURL& origin) OVERRIDE;
23 virtual bool IsStorageUnlimited(const GURL& origin) OVERRIDE;
24 virtual bool IsStorageSessionOnly(const GURL& origin) OVERRIDE;
25 virtual bool CanQueryDiskSize(const GURL& origin) OVERRIDE;
26 virtual bool IsFileHandler(const std::string& extension_id) OVERRIDE;
27 virtual bool HasSessionOnlyOrigins() OVERRIDE;
29 void AddProtected(const GURL& origin) {
30 protected_.insert(origin);
33 private:
34 virtual ~MockExtensionSpecialStoragePolicy();
36 std::set<GURL> protected_;
38 DISALLOW_COPY_AND_ASSIGN(MockExtensionSpecialStoragePolicy);
41 #endif // CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SPECIAL_STORAGE_POLICY_H_