blob: 00389b86b448cf7057e4d582e12c8629ee37f910 (
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
// Copyright (c) 2012 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_API_DECLARATIVE_DECLARATIVE_API_H__
#define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_DECLARATIVE_API_H__
#pragma once
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "chrome/browser/extensions/api/declarative/rules_registry.h"
#include "chrome/browser/extensions/extension_function.h"
namespace extensions {
class RulesFunction : public AsyncExtensionFunction {
public:
RulesFunction();
protected:
virtual ~RulesFunction();
// ExtensionFunction:
virtual bool RunImpl() OVERRIDE;
// Concrete implementation of the RulesFunction that is being called
// on the thread on which the respective RulesRegistry lives.
// Returns false in case of errors.
virtual bool RunImplOnCorrectThread() = 0;
scoped_refptr<RulesRegistry> rules_registry_;
};
class AddRulesFunction : public RulesFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME("declarative.addRules");
protected:
virtual ~AddRulesFunction() {}
// RulesFunction:
virtual bool RunImplOnCorrectThread() OVERRIDE;
};
class RemoveRulesFunction : public RulesFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME("declarative.removeRules");
protected:
virtual ~RemoveRulesFunction() {}
// RulesFunction:
virtual bool RunImplOnCorrectThread() OVERRIDE;
};
class GetRulesFunction : public RulesFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME("declarative.getRules");
protected:
virtual ~GetRulesFunction() {}
// RulesFunction:
virtual bool RunImplOnCorrectThread() OVERRIDE;
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_DECLARATIVE_API_H__
|