summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_content_settings_api.h
blob: 5a9ecb2f55439c9bda50f7707dd6b95715498211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTENT_SETTINGS_API_H__
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTENT_SETTINGS_API_H__
#pragma once

#include "chrome/browser/extensions/extension_function.h"

namespace webkit {
namespace npapi {
class PluginGroup;
}
}

class ClearContentSettingsFunction : public SyncExtensionFunction {
 public:
  virtual bool RunImpl() OVERRIDE;
  DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.clear")
};

class GetContentSettingFunction : public SyncExtensionFunction {
 public:
  virtual bool RunImpl() OVERRIDE;
  DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.get")
};

class SetContentSettingFunction : public SyncExtensionFunction {
 public:
  virtual bool RunImpl() OVERRIDE;
  DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.set")
};

class GetResourceIdentifiersFunction : public AsyncExtensionFunction {
 public:
  virtual bool RunImpl() OVERRIDE;
  DECLARE_EXTENSION_FUNCTION_NAME("contentSettings.getResourceIdentifiers")

 private:
  FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest,
                           ContentSettingsGetResourceIdentifiers);

  void OnGotPluginGroups(const std::vector<webkit::npapi::PluginGroup>& groups);

  // Used to override the global plugin list in tests.
  static void SetPluginGroupsForTesting(
      const std::vector<webkit::npapi::PluginGroup>* plugin_groups);
};

#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTENT_SETTINGS_API_H__