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

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

Issue 7492051: Revert 94332 - Removal of Profile from content part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->browser_context() != restrict_to_profile; 205 listener->process->profile() != restrict_to_profile;
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/debugger/devtools_window.cc ('k') | chrome/browser/extensions/extension_function_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698