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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 } | 1269 } |
1270 | 1270 |
1271 void Dispatcher::AddOrRemoveOriginPermissions( | 1271 void Dispatcher::AddOrRemoveOriginPermissions( |
1272 UpdatedExtensionPermissionsInfo::Reason reason, | 1272 UpdatedExtensionPermissionsInfo::Reason reason, |
1273 const Extension* extension, | 1273 const Extension* extension, |
1274 const URLPatternSet& origins) { | 1274 const URLPatternSet& origins) { |
1275 for (URLPatternSet::const_iterator i = origins.begin(); | 1275 for (URLPatternSet::const_iterator i = origins.begin(); |
1276 i != origins.end(); ++i) { | 1276 i != origins.end(); ++i) { |
1277 const char* schemes[] = { | 1277 const char* schemes[] = { |
1278 chrome::kHttpScheme, | 1278 chrome::kHttpScheme, |
1279 chrome::kHttpsScheme, | 1279 content::kHttpsScheme, |
1280 chrome::kFileScheme, | 1280 chrome::kFileScheme, |
1281 chrome::kChromeUIScheme, | 1281 chrome::kChromeUIScheme, |
1282 }; | 1282 }; |
1283 for (size_t j = 0; j < arraysize(schemes); ++j) { | 1283 for (size_t j = 0; j < arraysize(schemes); ++j) { |
1284 if (i->MatchesScheme(schemes[j])) { | 1284 if (i->MatchesScheme(schemes[j])) { |
1285 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) ? | 1285 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) ? |
1286 WebSecurityPolicy::removeOriginAccessWhitelistEntry : | 1286 WebSecurityPolicy::removeOriginAccessWhitelistEntry : |
1287 WebSecurityPolicy::addOriginAccessWhitelistEntry)( | 1287 WebSecurityPolicy::addOriginAccessWhitelistEntry)( |
1288 extension->url(), | 1288 extension->url(), |
1289 WebString::fromUTF8(schemes[j]), | 1289 WebString::fromUTF8(schemes[j]), |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 RenderView* background_view = | 1559 RenderView* background_view = |
1560 ExtensionHelper::GetBackgroundPage(extension_id); | 1560 ExtensionHelper::GetBackgroundPage(extension_id); |
1561 if (background_view) { | 1561 if (background_view) { |
1562 background_view->Send(new ExtensionHostMsg_EventAck( | 1562 background_view->Send(new ExtensionHostMsg_EventAck( |
1563 background_view->GetRoutingID())); | 1563 background_view->GetRoutingID())); |
1564 } | 1564 } |
1565 } | 1565 } |
1566 } | 1566 } |
1567 | 1567 |
1568 } // namespace extensions | 1568 } // namespace extensions |
OLD | NEW |