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

Side by Side Diff: extensions/renderer/user_script_injector.cc

Issue 822453002: Introduce HostID and de-couple Extensions from "script injection System" [browser side] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another round of comments of Devlin@. Created 5 years, 11 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
« extensions/common/consumer_id.cc ('K') | « extensions/extensions.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/user_script_injector.h" 5 #include "extensions/renderer/user_script_injector.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "content/public/common/url_constants.h" 10 #include "content/public/common/url_constants.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 blink::WebScriptSource GreasemonkeyApiJsString::GetSource() const { 48 blink::WebScriptSource GreasemonkeyApiJsString::GetSource() const {
49 return blink::WebScriptSource(blink::WebString::fromUTF8(source_)); 49 return blink::WebScriptSource(blink::WebString::fromUTF8(source_));
50 } 50 }
51 51
52 base::LazyInstance<GreasemonkeyApiJsString> g_greasemonkey_api = 52 base::LazyInstance<GreasemonkeyApiJsString> g_greasemonkey_api =
53 LAZY_INSTANCE_INITIALIZER; 53 LAZY_INSTANCE_INITIALIZER;
54 54
55 } // namespace 55 } // namespace
56 56
57 UserScriptInjector::UserScriptInjector( 57 UserScriptInjector::UserScriptInjector(const UserScript* script,
58 const UserScript* script, 58 UserScriptSet* script_list,
Devlin 2015/01/21 23:25:21 nit: It's best practice to not include changes lik
Xi Han 2015/01/22 17:19:36 Sorry, git cl format does these unnecessary change
59 UserScriptSet* script_list, 59 bool is_declarative)
60 bool is_declarative)
61 : script_(script), 60 : script_(script),
62 script_id_(script_->id()), 61 script_id_(script_->id()),
63 extension_id_(script_->extension_id()), 62 extension_id_(script_->extension_id()),
64 is_declarative_(is_declarative), 63 is_declarative_(is_declarative),
65 user_script_set_observer_(this) { 64 user_script_set_observer_(this) {
66 user_script_set_observer_.Add(script_list); 65 user_script_set_observer_.Add(script_list);
67 } 66 }
68 67
69 UserScriptInjector::~UserScriptInjector() { 68 UserScriptInjector::~UserScriptInjector() {
70 } 69 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 219 }
221 220
222 if (ShouldInjectCss(run_location)) 221 if (ShouldInjectCss(run_location))
223 scripts_run_info->num_css += script_->css_scripts().size(); 222 scripts_run_info->num_css += script_->css_scripts().size();
224 } 223 }
225 224
226 void UserScriptInjector::OnWillNotInject(InjectFailureReason reason) { 225 void UserScriptInjector::OnWillNotInject(InjectFailureReason reason) {
227 } 226 }
228 227
229 } // namespace extensions 228 } // namespace extensions
OLDNEW
« extensions/common/consumer_id.cc ('K') | « extensions/extensions.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698