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

Side by Side Diff: chrome/browser/extensions/api/processes/processes_api.cc

Issue 11440004: Remove deprecated extension EventRouter APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 8 years 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) 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/api/processes/processes_api.h" 5 #include "chrome/browser/extensions/api/processes/processes_api.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 // Third arg: The exit code for the process. 463 // Third arg: The exit code for the process.
464 args->Append(Value::CreateIntegerValue(details->exit_code)); 464 args->Append(Value::CreateIntegerValue(details->exit_code));
465 465
466 DispatchEvent(keys::kOnExited, args.Pass()); 466 DispatchEvent(keys::kOnExited, args.Pass());
467 #endif // defined(ENABLE_TASK_MANAGER) 467 #endif // defined(ENABLE_TASK_MANAGER)
468 } 468 }
469 469
470 void ProcessesEventRouter::DispatchEvent(const char* event_name, 470 void ProcessesEventRouter::DispatchEvent(const char* event_name,
471 scoped_ptr<ListValue> event_args) { 471 scoped_ptr<ListValue> event_args) {
472 if (extensions::ExtensionSystem::Get(profile_)->event_router()) { 472 if (extensions::ExtensionSystem::Get(profile_)->event_router()) {
473 scoped_ptr<extensions::Event> event(new extensions::Event(
474 event_name, event_args.Pass()));
473 extensions::ExtensionSystem::Get(profile_)->event_router()-> 475 extensions::ExtensionSystem::Get(profile_)->event_router()->
474 DispatchEventToRenderers(event_name, event_args.Pass(), NULL, GURL(), 476 BroadcastEvent(event.Pass());
475 extensions::EventFilteringInfo());
476 } 477 }
477 } 478 }
478 479
479 bool ProcessesEventRouter::HasEventListeners(const std::string& event_name) { 480 bool ProcessesEventRouter::HasEventListeners(const std::string& event_name) {
480 extensions::EventRouter* router = 481 extensions::EventRouter* router =
481 extensions::ExtensionSystem::Get(profile_)->event_router(); 482 extensions::ExtensionSystem::Get(profile_)->event_router();
482 if (router && router->HasEventListener(event_name)) 483 if (router && router->HasEventListener(event_name))
483 return true; 484 return true;
484 return false; 485 return false;
485 } 486 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 764
764 SetResult(processes); 765 SetResult(processes);
765 SendResponse(true); 766 SendResponse(true);
766 767
767 // Balance the AddRef in the RunImpl. 768 // Balance the AddRef in the RunImpl.
768 Release(); 769 Release();
769 #endif // defined(ENABLE_TASK_MANAGER) 770 #endif // defined(ENABLE_TASK_MANAGER)
770 } 771 }
771 772
772 } // namespace extensions 773 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698