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

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

Issue 315413004: Remove param |context_type| from InitOriginPermissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: is_extension_active Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | extensions/renderer/dispatcher_delegate.h » ('j') | 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/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/alias.h" 9 #include "base/debug/alias.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 extension_group, 252 extension_group,
253 ScriptContext::GetDataSourceURLForFrame(frame), 253 ScriptContext::GetDataSourceURLForFrame(frame),
254 frame->document().securityOrigin()); 254 frame->document().securityOrigin());
255 255
256 ScriptContext* context = 256 ScriptContext* context =
257 delegate_->CreateScriptContext(v8_context, frame, extension, context_type) 257 delegate_->CreateScriptContext(v8_context, frame, extension, context_type)
258 .release(); 258 .release();
259 script_context_set_.Add(context); 259 script_context_set_.Add(context);
260 260
261 if (extension) { 261 if (extension) {
262 InitOriginPermissions(extension, context_type); 262 InitOriginPermissions(extension);
263 } 263 }
264 264
265 { 265 {
266 scoped_ptr<ModuleSystem> module_system( 266 scoped_ptr<ModuleSystem> module_system(
267 new ModuleSystem(context, &source_map_)); 267 new ModuleSystem(context, &source_map_));
268 context->set_module_system(module_system.Pass()); 268 context->set_module_system(module_system.Pass());
269 } 269 }
270 ModuleSystem* module_system = context->module_system(); 270 ModuleSystem* module_system = context->module_system();
271 271
272 // Enable natives in startup. 272 // Enable natives in startup.
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 bool other_webrequest) { 790 bool other_webrequest) {
791 delegate_->HandleWebRequestAPIUsage(adblock, adblock_plus, other_webrequest); 791 delegate_->HandleWebRequestAPIUsage(adblock, adblock_plus, other_webrequest);
792 } 792 }
793 793
794 void Dispatcher::UpdateActiveExtensions() { 794 void Dispatcher::UpdateActiveExtensions() {
795 std::set<std::string> active_extensions = active_extension_ids_; 795 std::set<std::string> active_extensions = active_extension_ids_;
796 user_script_slave_->GetActiveExtensions(&active_extensions); 796 user_script_slave_->GetActiveExtensions(&active_extensions);
797 delegate_->OnActiveExtensionsUpdated(active_extensions); 797 delegate_->OnActiveExtensionsUpdated(active_extensions);
798 } 798 }
799 799
800 void Dispatcher::InitOriginPermissions(const Extension* extension, 800 void Dispatcher::InitOriginPermissions(const Extension* extension) {
801 Feature::Context context_type) { 801 delegate_->InitOriginPermissions(extension,
802 delegate_->InitOriginPermissions(extension, context_type); 802 IsExtensionActive(extension->id()));
803 UpdateOriginPermissions( 803 UpdateOriginPermissions(
804 UpdatedExtensionPermissionsInfo::ADDED, 804 UpdatedExtensionPermissionsInfo::ADDED,
805 extension, 805 extension,
806 extension->permissions_data()->GetEffectiveHostPermissions()); 806 extension->permissions_data()->GetEffectiveHostPermissions());
807 } 807 }
808 808
809 void Dispatcher::UpdateOriginPermissions( 809 void Dispatcher::UpdateOriginPermissions(
810 UpdatedExtensionPermissionsInfo::Reason reason, 810 UpdatedExtensionPermissionsInfo::Reason reason,
811 const Extension* extension, 811 const Extension* extension,
812 const URLPatternSet& origins) { 812 const URLPatternSet& origins) {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 return v8::Handle<v8::Object>(); 1233 return v8::Handle<v8::Object>();
1234 1234
1235 if (bind_name) 1235 if (bind_name)
1236 *bind_name = split.back(); 1236 *bind_name = split.back();
1237 1237
1238 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1238 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1239 : bind_object; 1239 : bind_object;
1240 } 1240 }
1241 1241
1242 } // namespace extensions 1242 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | extensions/renderer/dispatcher_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698