Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: chrome/browser/extensions/declarative_user_script_master.h

Issue 955473002: Move DeclarativeUserScriptManager/Master and UserScriptLoader to //extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 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.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MASTER_H_
6 #define CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MASTER_H_
7
8 #include "base/scoped_observer.h"
9 #include "chrome/browser/extensions/extension_user_script_loader.h"
10
11 class Profile;
12
13 namespace extensions {
14
15 class UserScript;
16
17 // Manages declarative user scripts for a single extension. Owns a
18 // UserScriptLoader to which file loading and shared memory management
19 // operations are delegated, and provides an interface for adding, removing,
20 // and clearing scripts.
21 class DeclarativeUserScriptMaster {
22 public:
23 DeclarativeUserScriptMaster(Profile* profile, const HostID& host_id);
24 ~DeclarativeUserScriptMaster();
25
26 // Adds script to shared memory region. This may not happen right away if a
27 // script load is in progress.
28 void AddScript(const UserScript& script);
29
30 // Removes script from shared memory region. This may not happen right away if
31 // a script load is in progress.
32 void RemoveScript(const UserScript& script);
33
34 // Removes all scripts from shared memory region. This may not happen right
35 // away if a script load is in progress.
36 void ClearScripts();
37
38 const HostID& host_id() const { return host_id_; }
39
40 private:
41 // ID of host that owns scripts that this component manages.
42 HostID host_id_;
43
44 // Script loader that handles loading contents of scripts into shared memory
45 // and notifying renderers of script updates.
46 ExtensionUserScriptLoader loader_;
47
48 DISALLOW_COPY_AND_ASSIGN(DeclarativeUserScriptMaster);
49 };
50
51 } // namespace extensions
52
53 #endif // CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MASTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698