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

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

Issue 959413003: Implement <webview>.addContentScript/removeContentScript API [1] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 #include "extensions/browser/declarative_user_script_master.h" 5 #include "extensions/browser/declarative_user_script_master.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "content/public/browser/browser_context.h" 9 #include "content/public/browser/browser_context.h"
10 10
(...skipping 10 matching lines...) Expand all
21 21
22 DeclarativeUserScriptMaster::~DeclarativeUserScriptMaster() { 22 DeclarativeUserScriptMaster::~DeclarativeUserScriptMaster() {
23 } 23 }
24 24
25 void DeclarativeUserScriptMaster::AddScript(const UserScript& script) { 25 void DeclarativeUserScriptMaster::AddScript(const UserScript& script) {
26 std::set<UserScript> set; 26 std::set<UserScript> set;
27 set.insert(script); 27 set.insert(script);
28 loader_.AddScripts(set); 28 loader_.AddScripts(set);
29 } 29 }
30 30
31 void DeclarativeUserScriptMaster::AddScripts(
32 const std::set<UserScript>& scripts) {
33 loader_.AddScripts(scripts);
34 }
35
31 void DeclarativeUserScriptMaster::RemoveScript(const UserScript& script) { 36 void DeclarativeUserScriptMaster::RemoveScript(const UserScript& script) {
32 std::set<UserScript> set; 37 std::set<UserScript> set;
33 set.insert(script); 38 set.insert(script);
34 loader_.RemoveScripts(set); 39 loader_.RemoveScripts(set);
35 } 40 }
36 41
42 void DeclarativeUserScriptMaster::RemoveScripts(
43 const std::set<UserScript>& scripts) {
44 loader_.RemoveScripts(scripts);
45 }
46
37 void DeclarativeUserScriptMaster::ClearScripts() { 47 void DeclarativeUserScriptMaster::ClearScripts() {
38 loader_.ClearScripts(); 48 loader_.ClearScripts();
39 } 49 }
40 50
41 } // namespace extensions 51 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698