Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: chrome/browser/extensions/extension_event_router.cc

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: works now Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // Don't send browser-level events to unprivileged processes. 196 // Don't send browser-level events to unprivileged processes.
197 continue; 197 continue;
198 } 198 }
199 199
200 if (!extension_id.empty() && extension_id != listener->extension_id) 200 if (!extension_id.empty() && extension_id != listener->extension_id)
201 continue; 201 continue;
202 202
203 // Is this event from a different profile than the renderer (ie, an 203 // Is this event from a different profile than the renderer (ie, an
204 // incognito tab event sent to a normal process, or vice versa). 204 // incognito tab event sent to a normal process, or vice versa).
205 bool cross_incognito = restrict_to_profile && 205 bool cross_incognito = restrict_to_profile &&
206 listener->process->profile() != restrict_to_profile; 206 listener->process->context() != restrict_to_profile;
207 const Extension* extension = service->GetExtensionById( 207 const Extension* extension = service->GetExtensionById(
208 listener->extension_id, false); 208 listener->extension_id, false);
209 // Send the event with different arguments to extensions that can't 209 // Send the event with different arguments to extensions that can't
210 // cross incognito, if necessary. 210 // cross incognito, if necessary.
211 if (cross_incognito && !service->CanCrossIncognito(extension)) { 211 if (cross_incognito && !service->CanCrossIncognito(extension)) {
212 if (!cross_incognito_args.empty()) { 212 if (!cross_incognito_args.empty()) {
213 DispatchEvent(listener->process, listener->extension_id, 213 DispatchEvent(listener->process, listener->extension_id,
214 event_name, cross_incognito_args, event_url); 214 event_name, cross_incognito_args, event_url);
215 } 215 }
216 continue; 216 continue;
(...skipping 25 matching lines...) Expand all
242 } 242 }
243 } 243 }
244 } 244 }
245 break; 245 break;
246 } 246 }
247 default: 247 default:
248 NOTREACHED(); 248 NOTREACHED();
249 return; 249 return;
250 } 250 }
251 } 251 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698