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

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

Issue 10559052: Split mode incognito extension can get misleading pref changed events from regular mode (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed some callbacks, other nits Created 8 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_pref_value_map.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/extension_event_router.h" 5 #include "chrome/browser/extensions/extension_event_router.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 listener_profile->GetExtensionService()->process_map(); 374 listener_profile->GetExtensionService()->process_map();
375 // If the event is privileged, only send to extension processes. Otherwise, 375 // If the event is privileged, only send to extension processes. Otherwise,
376 // it's OK to send to normal renderers (e.g., for content scripts). 376 // it's OK to send to normal renderers (e.g., for content scripts).
377 if (ExtensionAPI::GetSharedInstance()->IsPrivileged(event->event_name) && 377 if (ExtensionAPI::GetSharedInstance()->IsPrivileged(event->event_name) &&
378 !process_map->Contains(extension->id(), listener.process->GetID())) { 378 !process_map->Contains(extension->id(), listener.process->GetID())) {
379 return; 379 return;
380 } 380 }
381 381
382 const Value* event_args = NULL; 382 const Value* event_args = NULL;
383 if (!CanDispatchEventToProfile(listener_profile, extension, 383 if (!CanDispatchEventToProfile(listener_profile, extension,
384 event, &event_args)) 384 event, &event_args)) {
385 return; 385 return;
386 }
386 387
387 DispatchEvent(listener.process, listener.extension_id, 388 DispatchEvent(listener.process, listener.extension_id,
388 event->event_name, *event_args, 389 event->event_name, *event_args,
389 event->event_url, event->user_gesture); 390 event->event_url, event->user_gesture);
390 IncrementInFlightEvents(listener_profile, extension); 391 IncrementInFlightEvents(listener_profile, extension);
391 } 392 }
392 393
393 bool ExtensionEventRouter::CanDispatchEventToProfile( 394 bool ExtensionEventRouter::CanDispatchEventToProfile(
394 Profile* profile, 395 Profile* profile,
395 const Extension* extension, 396 const Extension* extension,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 MessageLoop::current()->PostTask(FROM_HERE, 559 MessageLoop::current()->PostTask(FROM_HERE,
559 base::Bind(&extensions::RuntimeEventRouter::DispatchOnInstalledEvent, 560 base::Bind(&extensions::RuntimeEventRouter::DispatchOnInstalledEvent,
560 profile_, extension->id())); 561 profile_, extension->id()));
561 break; 562 break;
562 } 563 }
563 default: 564 default:
564 NOTREACHED(); 565 NOTREACHED();
565 return; 566 return;
566 } 567 }
567 } 568 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_pref_value_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698