| 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/browser/extensions/active_tab_permission_granter.h" | 5 #include "chrome/browser/extensions/active_tab_permission_granter.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/extensions/extension_system.h" | 8 #include "chrome/browser/extensions/extension_system.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sessions/session_id.h" | 10 #include "chrome/browser/sessions/session_id.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 100 } |
| 101 | 101 |
| 102 void ActiveTabPermissionGranter::ClearActiveExtensionsAndNotify() { | 102 void ActiveTabPermissionGranter::ClearActiveExtensionsAndNotify() { |
| 103 if (granted_extensions_.is_empty()) | 103 if (granted_extensions_.is_empty()) |
| 104 return; | 104 return; |
| 105 | 105 |
| 106 std::vector<std::string> extension_ids; | 106 std::vector<std::string> extension_ids; |
| 107 | 107 |
| 108 for (ExtensionSet::const_iterator it = granted_extensions_.begin(); | 108 for (ExtensionSet::const_iterator it = granted_extensions_.begin(); |
| 109 it != granted_extensions_.end(); ++it) { | 109 it != granted_extensions_.end(); ++it) { |
| 110 PermissionsData::ClearTabSpecificPermissions(*it, tab_id_); | 110 PermissionsData::ClearTabSpecificPermissions(it->get(), tab_id_); |
| 111 extension_ids.push_back((*it)->id()); | 111 extension_ids.push_back((*it)->id()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 Send(new ExtensionMsg_ClearTabSpecificPermissions(tab_id_, extension_ids)); | 114 Send(new ExtensionMsg_ClearTabSpecificPermissions(tab_id_, extension_ids)); |
| 115 granted_extensions_.Clear(); | 115 granted_extensions_.Clear(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 int32 ActiveTabPermissionGranter::GetPageID() { | 118 int32 ActiveTabPermissionGranter::GetPageID() { |
| 119 return web_contents()->GetController().GetActiveEntry()->GetPageID(); | 119 return web_contents()->GetController().GetActiveEntry()->GetPageID(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace extensions | 122 } // namespace extensions |
| OLD | NEW |