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 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 extension->GetActivePermissions()->explicit_hosts()); | 1274 extension->GetActivePermissions()->explicit_hosts()); |
1275 } | 1275 } |
1276 | 1276 |
1277 void Dispatcher::AddOrRemoveOriginPermissions( | 1277 void Dispatcher::AddOrRemoveOriginPermissions( |
1278 UpdatedExtensionPermissionsInfo::Reason reason, | 1278 UpdatedExtensionPermissionsInfo::Reason reason, |
1279 const Extension* extension, | 1279 const Extension* extension, |
1280 const URLPatternSet& origins) { | 1280 const URLPatternSet& origins) { |
1281 for (URLPatternSet::const_iterator i = origins.begin(); | 1281 for (URLPatternSet::const_iterator i = origins.begin(); |
1282 i != origins.end(); ++i) { | 1282 i != origins.end(); ++i) { |
1283 const char* schemes[] = { | 1283 const char* schemes[] = { |
1284 chrome::kHttpScheme, | 1284 content::kHttpScheme, |
1285 content::kHttpsScheme, | 1285 content::kHttpsScheme, |
1286 chrome::kFileScheme, | 1286 chrome::kFileScheme, |
1287 chrome::kChromeUIScheme, | 1287 chrome::kChromeUIScheme, |
1288 }; | 1288 }; |
1289 for (size_t j = 0; j < arraysize(schemes); ++j) { | 1289 for (size_t j = 0; j < arraysize(schemes); ++j) { |
1290 if (i->MatchesScheme(schemes[j])) { | 1290 if (i->MatchesScheme(schemes[j])) { |
1291 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) ? | 1291 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) ? |
1292 WebSecurityPolicy::removeOriginAccessWhitelistEntry : | 1292 WebSecurityPolicy::removeOriginAccessWhitelistEntry : |
1293 WebSecurityPolicy::addOriginAccessWhitelistEntry)( | 1293 WebSecurityPolicy::addOriginAccessWhitelistEntry)( |
1294 extension->url(), | 1294 extension->url(), |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 RenderView* background_view = | 1568 RenderView* background_view = |
1569 ExtensionHelper::GetBackgroundPage(extension_id); | 1569 ExtensionHelper::GetBackgroundPage(extension_id); |
1570 if (background_view) { | 1570 if (background_view) { |
1571 background_view->Send(new ExtensionHostMsg_EventAck( | 1571 background_view->Send(new ExtensionHostMsg_EventAck( |
1572 background_view->GetRoutingID())); | 1572 background_view->GetRoutingID())); |
1573 } | 1573 } |
1574 } | 1574 } |
1575 } | 1575 } |
1576 | 1576 |
1577 } // namespace extensions | 1577 } // namespace extensions |
OLD | NEW |