Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_event_router.h" | 5 #include "chrome/browser/extensions/extension_event_router.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/extensions/extension_devtools_manager.h" | 8 #include "chrome/browser/extensions/extension_devtools_manager.h" |
| 9 #include "chrome/browser/extensions/extension_processes_api.h" | 9 #include "chrome/browser/extensions/extension_processes_api.h" |
| 10 #include "chrome/browser/extensions/extension_processes_api_constants.h" | 10 #include "chrome/browser/extensions/extension_processes_api_constants.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 // Don't send browser-level events to unprivileged processes. | 195 // Don't send browser-level events to unprivileged processes. |
| 196 continue; | 196 continue; |
| 197 } | 197 } |
| 198 | 198 |
| 199 if (!extension_id.empty() && extension_id != listener->extension_id) | 199 if (!extension_id.empty() && extension_id != listener->extension_id) |
| 200 continue; | 200 continue; |
| 201 | 201 |
| 202 // Is this event from a different profile than the renderer (ie, an | 202 // Is this event from a different profile than the renderer (ie, an |
| 203 // incognito tab event sent to a normal process, or vice versa). | 203 // incognito tab event sent to a normal process, or vice versa). |
| 204 bool cross_incognito = restrict_to_profile && | 204 bool cross_incognito = restrict_to_profile && |
| 205 listener->process->profile() != restrict_to_profile; | 205 listener->process->browser_context() != restrict_to_profile; |
|
jam
2011/07/27 17:17:57
will this automatically cast the Profile* to a Bro
| |
| 206 const Extension* extension = service->GetExtensionById( | 206 const Extension* extension = service->GetExtensionById( |
| 207 listener->extension_id, false); | 207 listener->extension_id, false); |
| 208 // Send the event with different arguments to extensions that can't | 208 // Send the event with different arguments to extensions that can't |
| 209 // cross incognito, if necessary. | 209 // cross incognito, if necessary. |
| 210 if (cross_incognito && !service->CanCrossIncognito(extension)) { | 210 if (cross_incognito && !service->CanCrossIncognito(extension)) { |
| 211 if (!cross_incognito_args.empty()) { | 211 if (!cross_incognito_args.empty()) { |
| 212 DispatchEvent(listener->process, listener->extension_id, | 212 DispatchEvent(listener->process, listener->extension_id, |
| 213 event_name, cross_incognito_args, event_url); | 213 event_name, cross_incognito_args, event_url); |
| 214 } | 214 } |
| 215 continue; | 215 continue; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 241 } | 241 } |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 break; | 244 break; |
| 245 } | 245 } |
| 246 default: | 246 default: |
| 247 NOTREACHED(); | 247 NOTREACHED(); |
| 248 return; | 248 return; |
| 249 } | 249 } |
| 250 } | 250 } |
| OLD | NEW |