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

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

Issue 8480007: Change EXTENSION_PROCESS_CREATED observers to use EXTENSION_HOST_CREATED. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 1 month 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "chrome/browser/extensions/extension_process_manager.h" 7 #include "chrome/browser/extensions/extension_process_manager.h"
8 8
9 #include "chrome/browser/ui/browser_window.h" 9 #include "chrome/browser/ui/browser_window.h"
10 #include "content/browser/browsing_instance.h" 10 #include "content/browser/browsing_instance.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 } 527 }
528 } 528 }
529 529
530 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, 530 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host,
531 bool is_background) { 531 bool is_background) {
532 DCHECK_EQ(browsing_instance_->browser_context(), host->profile()); 532 DCHECK_EQ(browsing_instance_->browser_context(), host->profile());
533 533
534 all_hosts_.insert(host); 534 all_hosts_.insert(host);
535 if (is_background) 535 if (is_background)
536 background_hosts_.insert(host); 536 background_hosts_.insert(host);
537 content::NotificationService::current()->Notify(
538 chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
539 content::Source<ExtensionProcessManager>(this),
540 content::Details<ExtensionHost>(host));
541 } 537 }
542 538
543 void ExtensionProcessManager::CloseBackgroundHost(ExtensionHost* host) { 539 void ExtensionProcessManager::CloseBackgroundHost(ExtensionHost* host) {
544 CHECK(host->extension_host_type() == 540 CHECK(host->extension_host_type() ==
545 chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE); 541 chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE);
546 delete host; 542 delete host;
547 // |host| should deregister itself from our structures. 543 // |host| should deregister itself from our structures.
548 CHECK(background_hosts_.find(host) == background_hosts_.end()); 544 CHECK(background_hosts_.find(host) == background_hosts_.end());
549 } 545 }
550 546
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 if (service && service->is_ready()) 673 if (service && service->is_ready())
678 CreateBackgroundHostsForProfileStartup(this, service->extensions()); 674 CreateBackgroundHostsForProfileStartup(this, service->extensions());
679 } 675 }
680 break; 676 break;
681 } 677 }
682 default: 678 default:
683 ExtensionProcessManager::Observe(type, source, details); 679 ExtensionProcessManager::Observe(type, source, details);
684 break; 680 break;
685 } 681 }
686 } 682 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_process_manager.h ('k') | chrome/browser/task_manager/task_manager_resource_providers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698