OLD | NEW |
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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 | 788 |
789 void Dispatcher::UpdateOriginPermissions( | 789 void Dispatcher::UpdateOriginPermissions( |
790 UpdatedExtensionPermissionsInfo::Reason reason, | 790 UpdatedExtensionPermissionsInfo::Reason reason, |
791 const Extension* extension, | 791 const Extension* extension, |
792 const URLPatternSet& origins) { | 792 const URLPatternSet& origins) { |
793 for (URLPatternSet::const_iterator i = origins.begin(); i != origins.end(); | 793 for (URLPatternSet::const_iterator i = origins.begin(); i != origins.end(); |
794 ++i) { | 794 ++i) { |
795 const char* schemes[] = { | 795 const char* schemes[] = { |
796 url::kHttpScheme, | 796 url::kHttpScheme, |
797 url::kHttpsScheme, | 797 url::kHttpsScheme, |
798 content::kFileScheme, | 798 url::kFileScheme, |
799 content::kChromeUIScheme, | 799 content::kChromeUIScheme, |
800 content::kFtpScheme, | 800 url::kFtpScheme, |
801 }; | 801 }; |
802 for (size_t j = 0; j < arraysize(schemes); ++j) { | 802 for (size_t j = 0; j < arraysize(schemes); ++j) { |
803 if (i->MatchesScheme(schemes[j])) { | 803 if (i->MatchesScheme(schemes[j])) { |
804 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) | 804 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) |
805 ? WebSecurityPolicy::removeOriginAccessWhitelistEntry | 805 ? WebSecurityPolicy::removeOriginAccessWhitelistEntry |
806 : WebSecurityPolicy::addOriginAccessWhitelistEntry)( | 806 : WebSecurityPolicy::addOriginAccessWhitelistEntry)( |
807 extension->url(), | 807 extension->url(), |
808 WebString::fromUTF8(schemes[j]), | 808 WebString::fromUTF8(schemes[j]), |
809 WebString::fromUTF8(i->host()), | 809 WebString::fromUTF8(i->host()), |
810 i->match_subdomains()); | 810 i->match_subdomains()); |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 return v8::Handle<v8::Object>(); | 1213 return v8::Handle<v8::Object>(); |
1214 | 1214 |
1215 if (bind_name) | 1215 if (bind_name) |
1216 *bind_name = split.back(); | 1216 *bind_name = split.back(); |
1217 | 1217 |
1218 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) | 1218 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) |
1219 : bind_object; | 1219 : bind_object; |
1220 } | 1220 } |
1221 | 1221 |
1222 } // namespace extensions | 1222 } // namespace extensions |
OLD | NEW |