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
27 // Note: when dealing with WebContents associated with OffTheRecord contexts,
28 // functions on this interface must be invoked for BOTH the Original and
29 // OffTheRecord ContentRulesRegistry instances. This is necessary because the
30 // Original ContentRulesRegistry instance handles spanning-mode incognito
32 class ContentRulesRegistry
: public RulesRegistry
{
34 ContentRulesRegistry(content::BrowserContext
* browser_context
,
35 const std::string
& event_name
,
36 content::BrowserThread::ID owner_thread
,
37 RulesCacheDelegate
* cache_delegate
,
38 int rules_registry_id
)
39 : RulesRegistry(browser_context
,
45 // Notifies the registry that it should evaluate rules for |contents|.
46 virtual void MonitorWebContentsForRuleEvaluation(
47 content::WebContents
* contents
) = 0;
49 // Applies all content rules given that a tab was just navigated.
50 virtual void DidNavigateMainFrame(
51 content::WebContents
* tab
,
52 const content::LoadCommittedDetails
& details
,
53 const content::FrameNavigateParams
& params
) = 0;
56 ~ContentRulesRegistry() override
{}
59 DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry
);
62 } // namespace extensions
64 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__