| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/dispatcher.h" | 5 #include "chrome/renderer/extensions/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/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 | 1350 |
| 1351 void Dispatcher::AddOrRemoveOriginPermissions( | 1351 void Dispatcher::AddOrRemoveOriginPermissions( |
| 1352 UpdatedExtensionPermissionsInfo::Reason reason, | 1352 UpdatedExtensionPermissionsInfo::Reason reason, |
| 1353 const Extension* extension, | 1353 const Extension* extension, |
| 1354 const URLPatternSet& origins) { | 1354 const URLPatternSet& origins) { |
| 1355 for (URLPatternSet::const_iterator i = origins.begin(); | 1355 for (URLPatternSet::const_iterator i = origins.begin(); |
| 1356 i != origins.end(); ++i) { | 1356 i != origins.end(); ++i) { |
| 1357 const char* schemes[] = { | 1357 const char* schemes[] = { |
| 1358 content::kHttpScheme, | 1358 content::kHttpScheme, |
| 1359 content::kHttpsScheme, | 1359 content::kHttpsScheme, |
| 1360 chrome::kFileScheme, | 1360 content::kFileScheme, |
| 1361 chrome::kChromeUIScheme, | 1361 chrome::kChromeUIScheme, |
| 1362 }; | 1362 }; |
| 1363 for (size_t j = 0; j < arraysize(schemes); ++j) { | 1363 for (size_t j = 0; j < arraysize(schemes); ++j) { |
| 1364 if (i->MatchesScheme(schemes[j])) { | 1364 if (i->MatchesScheme(schemes[j])) { |
| 1365 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) ? | 1365 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) ? |
| 1366 WebSecurityPolicy::removeOriginAccessWhitelistEntry : | 1366 WebSecurityPolicy::removeOriginAccessWhitelistEntry : |
| 1367 WebSecurityPolicy::addOriginAccessWhitelistEntry)( | 1367 WebSecurityPolicy::addOriginAccessWhitelistEntry)( |
| 1368 extension->url(), | 1368 extension->url(), |
| 1369 WebString::fromUTF8(schemes[j]), | 1369 WebString::fromUTF8(schemes[j]), |
| 1370 WebString::fromUTF8(i->host()), | 1370 WebString::fromUTF8(i->host()), |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 RenderView* background_view = | 1661 RenderView* background_view = |
| 1662 ExtensionHelper::GetBackgroundPage(extension_id); | 1662 ExtensionHelper::GetBackgroundPage(extension_id); |
| 1663 if (background_view) { | 1663 if (background_view) { |
| 1664 background_view->Send(new ExtensionHostMsg_EventAck( | 1664 background_view->Send(new ExtensionHostMsg_EventAck( |
| 1665 background_view->GetRoutingID())); | 1665 background_view->GetRoutingID())); |
| 1666 } | 1666 } |
| 1667 } | 1667 } |
| 1668 } | 1668 } |
| 1669 | 1669 |
| 1670 } // namespace extensions | 1670 } // namespace extensions |
| OLD | NEW |