1 // Copyright (c) 2014 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 EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__
6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__
10 #include "content/public/browser/browser_thread.h"
11 #include "extensions/browser/api/declarative/rules_registry.h"
16 struct FrameNavigateParams
;
17 struct LoadCommittedDetails
;
20 namespace extensions
{
22 // This class acts as an //extensions-side interface for ContentRulesRegistry
23 // to allow RulesRegistryService to be moved to //extensions.
24 // TODO(wjmaclean): Remove this once ContentRulesRegistry moves to
26 class ContentRulesRegistry
: public RulesRegistry
{
28 ContentRulesRegistry(content::BrowserContext
* browser_context
,
29 const std::string
& event_name
,
30 content::BrowserThread::ID owner_thread
,
31 RulesCacheDelegate
* cache_delegate
,
32 int rules_registry_id
)
33 : RulesRegistry(browser_context
,
39 // Applies all content rules given an update (CSS match change or
40 // page navigation, for now) from the renderer.
42 content::WebContents
* contents
,
43 const std::vector
<std::string
>& matching_css_selectors
) = 0;
45 // Applies all content rules given that a tab was just navigated.
46 virtual void DidNavigateMainFrame(
47 content::WebContents
* tab
,
48 const content::LoadCommittedDetails
& details
,
49 const content::FrameNavigateParams
& params
) = 0;
51 // Applies all content rules given that a tab was just navigated on the
52 // original context. Only invoked on the OffTheRecord registry instance.
53 virtual void DidNavigateMainFrameOfOriginalContext(
54 content::WebContents
* tab
,
55 const content::LoadCommittedDetails
& details
,
56 const content::FrameNavigateParams
& params
) = 0;
59 ~ContentRulesRegistry() override
{}
62 DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry
);
65 } // namespace extensions
67 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__