OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/renderer/extensions/extension_dispatcher.h" | 5 #include "chrome/renderer/extensions/extension_dispatcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/common/child_process_logging.h" | 8 #include "chrome/common/child_process_logging.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 WebString::fromUTF8(chrome::kChromeUIScheme), | 371 WebString::fromUTF8(chrome::kChromeUIScheme), |
372 WebString::fromUTF8(chrome::kChromeUIExtensionIconHost), | 372 WebString::fromUTF8(chrome::kChromeUIExtensionIconHost), |
373 false); | 373 false); |
374 } | 374 } |
375 | 375 |
376 UpdateOriginPermissions(UpdatedExtensionPermissionsInfo::ADDED, | 376 UpdateOriginPermissions(UpdatedExtensionPermissionsInfo::ADDED, |
377 extension, | 377 extension, |
378 extension->GetActivePermissions()->explicit_hosts()); | 378 extension->GetActivePermissions()->explicit_hosts()); |
379 } | 379 } |
380 | 380 |
| 381 // TODO(ericu): What needs to be done here? Do filesystem URLs enter into |
| 382 // extension permissions at all? |
381 void ExtensionDispatcher::UpdateOriginPermissions( | 383 void ExtensionDispatcher::UpdateOriginPermissions( |
382 UpdatedExtensionPermissionsInfo::Reason reason, | 384 UpdatedExtensionPermissionsInfo::Reason reason, |
383 const Extension* extension, | 385 const Extension* extension, |
384 const URLPatternSet& origins) { | 386 const URLPatternSet& origins) { |
385 for (URLPatternSet::const_iterator i = origins.begin(); | 387 for (URLPatternSet::const_iterator i = origins.begin(); |
386 i != origins.end(); ++i) { | 388 i != origins.end(); ++i) { |
387 const char* schemes[] = { | 389 const char* schemes[] = { |
388 chrome::kHttpScheme, | 390 chrome::kHttpScheme, |
389 chrome::kHttpsScheme, | 391 chrome::kHttpsScheme, |
390 chrome::kFileScheme, | 392 chrome::kFileScheme, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 459 |
458 RenderThread::Get()->RegisterExtension(extension); | 460 RenderThread::Get()->RegisterExtension(extension); |
459 } | 461 } |
460 | 462 |
461 void ExtensionDispatcher::OnUsingWebRequestAPI( | 463 void ExtensionDispatcher::OnUsingWebRequestAPI( |
462 bool adblock, bool adblock_plus, bool other) { | 464 bool adblock, bool adblock_plus, bool other) { |
463 webrequest_adblock_ = adblock; | 465 webrequest_adblock_ = adblock; |
464 webrequest_adblock_plus_ = adblock_plus; | 466 webrequest_adblock_plus_ = adblock_plus; |
465 webrequest_other_ = other; | 467 webrequest_other_ = other; |
466 } | 468 } |
OLD | NEW |