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

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

Issue 959413003: Implement <webview>.addContentScript/removeContentScript API [1] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up in web_view_internal_api.cc. Created 5 years, 8 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_ 5 #ifndef EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_
6 #define EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_ 6 #define EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_
7 7
8 #include "base/scoped_observer.h" 8 #include "base/scoped_observer.h"
9 #include "extensions/browser/extension_user_script_loader.h" 9 #include "extensions/browser/extension_user_script_loader.h"
10 10
(...skipping 12 matching lines...) Expand all
23 class DeclarativeUserScriptMaster { 23 class DeclarativeUserScriptMaster {
24 public: 24 public:
25 DeclarativeUserScriptMaster(content::BrowserContext* browser_context, 25 DeclarativeUserScriptMaster(content::BrowserContext* browser_context,
26 const HostID& host_id); 26 const HostID& host_id);
27 ~DeclarativeUserScriptMaster(); 27 ~DeclarativeUserScriptMaster();
28 28
29 // Adds script to shared memory region. This may not happen right away if a 29 // Adds script to shared memory region. This may not happen right away if a
30 // script load is in progress. 30 // script load is in progress.
31 void AddScript(const UserScript& script); 31 void AddScript(const UserScript& script);
32 32
33 // Adds a set of scripts to shared memory region. This may not happen right
34 // away if a script load is in progress.
35 void AddScripts(const std::set<UserScript>& scripts);
36
33 // Removes script from shared memory region. This may not happen right away if 37 // Removes script from shared memory region. This may not happen right away if
34 // a script load is in progress. 38 // a script load is in progress.
35 void RemoveScript(const UserScript& script); 39 void RemoveScript(const UserScript& script);
36 40
41 // Removes a set of scripts from shared memory region. This may not happen
42 // right away if a script load is in progress.
43 void RemoveScripts(const std::set<UserScript>& scripts);
44
37 // Removes all scripts from shared memory region. This may not happen right 45 // Removes all scripts from shared memory region. This may not happen right
38 // away if a script load is in progress. 46 // away if a script load is in progress.
39 void ClearScripts(); 47 void ClearScripts();
40 48
41 const HostID& host_id() const { return host_id_; } 49 const HostID& host_id() const { return host_id_; }
42 50
43 private: 51 private:
44 // ID of host that owns scripts that this component manages. 52 // ID of host that owns scripts that this component manages.
45 HostID host_id_; 53 HostID host_id_;
46 54
47 // Script loader that handles loading contents of scripts into shared memory 55 // Script loader that handles loading contents of scripts into shared memory
48 // and notifying renderers of script updates. 56 // and notifying renderers of script updates.
49 ExtensionUserScriptLoader loader_; 57 ExtensionUserScriptLoader loader_;
50 58
51 DISALLOW_COPY_AND_ASSIGN(DeclarativeUserScriptMaster); 59 DISALLOW_COPY_AND_ASSIGN(DeclarativeUserScriptMaster);
52 }; 60 };
53 61
54 } // namespace extensions 62 } // namespace extensions
55 63
56 #endif // EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_ 64 #endif // EXTENSIONS_BROWSER_DECLARATIVE_USER_SCRIPT_MASTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698