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

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

Issue 451005: Merge 33269 - Revert 33255 Report active extensions in crash reports. This o... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/extensions_service.h" 5 #include "chrome/browser/extensions/extensions_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/histogram.h" 9 #include "base/histogram.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/chrome_thread.h" 14 #include "chrome/browser/chrome_thread.h"
15 #include "chrome/browser/debugger/devtools_manager.h" 15 #include "chrome/browser/debugger/devtools_manager.h"
16 #include "chrome/browser/extensions/crx_installer.h" 16 #include "chrome/browser/extensions/crx_installer.h"
17 #include "chrome/browser/extensions/extension_browser_event_router.h" 17 #include "chrome/browser/extensions/extension_browser_event_router.h"
18 #include "chrome/browser/extensions/extension_dom_ui.h" 18 #include "chrome/browser/extensions/extension_dom_ui.h"
19 #include "chrome/browser/extensions/extension_file_util.h" 19 #include "chrome/browser/extensions/extension_file_util.h"
20 #include "chrome/browser/extensions/extension_history_api.h" 20 #include "chrome/browser/extensions/extension_history_api.h"
21 #include "chrome/browser/extensions/extension_process_manager.h" 21 #include "chrome/browser/extensions/extension_process_manager.h"
22 #include "chrome/browser/extensions/extension_updater.h" 22 #include "chrome/browser/extensions/extension_updater.h"
23 #include "chrome/browser/extensions/external_extension_provider.h" 23 #include "chrome/browser/extensions/external_extension_provider.h"
24 #include "chrome/browser/extensions/external_pref_extension_provider.h" 24 #include "chrome/browser/extensions/external_pref_extension_provider.h"
25 #include "chrome/browser/profile.h" 25 #include "chrome/browser/profile.h"
26 #include "chrome/browser/net/chrome_url_request_context.h" 26 #include "chrome/browser/net/chrome_url_request_context.h"
27 #include "chrome/common/child_process_logging.h"
28 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
29 #include "chrome/common/extensions/extension.h" 28 #include "chrome/common/extensions/extension.h"
30 #include "chrome/common/extensions/extension_constants.h" 29 #include "chrome/common/extensions/extension_constants.h"
31 #include "chrome/common/extensions/extension_error_reporter.h" 30 #include "chrome/common/extensions/extension_error_reporter.h"
32 #include "chrome/common/notification_service.h" 31 #include "chrome/common/notification_service.h"
33 #include "chrome/common/notification_type.h" 32 #include "chrome/common/notification_type.h"
34 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
35 #include "chrome/common/pref_service.h" 34 #include "chrome/common/pref_service.h"
36 #include "chrome/common/url_constants.h" 35 #include "chrome/common/url_constants.h"
37 36
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 402
404 NotificationService::current()->Notify( 403 NotificationService::current()->Notify(
405 NotificationType::EXTENSION_LOADED, 404 NotificationType::EXTENSION_LOADED,
406 Source<Profile>(profile_), 405 Source<Profile>(profile_),
407 Details<Extension>(extension)); 406 Details<Extension>(extension));
408 } 407 }
409 408
410 void ExtensionsService::NotifyExtensionUnloaded(Extension* extension) { 409 void ExtensionsService::NotifyExtensionUnloaded(Extension* extension) {
411 LOG(INFO) << "Sending EXTENSION_UNLOADED"; 410 LOG(INFO) << "Sending EXTENSION_UNLOADED";
412 411
413 UpdateActiveExtensionsInCrashReporter();
414
415 NotificationService::current()->Notify( 412 NotificationService::current()->Notify(
416 NotificationType::EXTENSION_UNLOADED, 413 NotificationType::EXTENSION_UNLOADED,
417 Source<Profile>(profile_), 414 Source<Profile>(profile_),
418 Details<Extension>(extension)); 415 Details<Extension>(extension));
419 416
420 if (profile_ && !profile_->IsOffTheRecord()) { 417 if (profile_ && !profile_->IsOffTheRecord()) {
421 ChromeURLRequestContextGetter* context_getter = 418 ChromeURLRequestContextGetter* context_getter =
422 static_cast<ChromeURLRequestContextGetter*>( 419 static_cast<ChromeURLRequestContextGetter*>(
423 profile_->GetRequestContext()); 420 profile_->GetRequestContext());
424 if (context_getter) { 421 if (context_getter) {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 NotificationType::EXTENSION_UPDATE_DISABLED, 609 NotificationType::EXTENSION_UPDATE_DISABLED,
613 Source<Profile>(profile_), 610 Source<Profile>(profile_),
614 Details<Extension>(extension)); 611 Details<Extension>(extension));
615 disabled_extensions_.push_back(scoped_extension.release()); 612 disabled_extensions_.push_back(scoped_extension.release());
616 break; 613 break;
617 default: 614 default:
618 NOTREACHED(); 615 NOTREACHED();
619 break; 616 break;
620 } 617 }
621 } 618 }
622
623 UpdateActiveExtensionsInCrashReporter();
624 }
625
626 void ExtensionsService::UpdateActiveExtensionsInCrashReporter() {
627 std::vector<std::string> extension_ids;
628 for (size_t i = 0; i < extensions_.size(); ++i)
629 extension_ids.push_back(extensions_[i]->id());
630
631 child_process_logging::SetActiveExtensions(extension_ids);
632 } 619 }
633 620
634 void ExtensionsService::OnExtensionInstalled(Extension* extension, 621 void ExtensionsService::OnExtensionInstalled(Extension* extension,
635 bool allow_privilege_increase) { 622 bool allow_privilege_increase) {
636 extension_prefs_->OnExtensionInstalled(extension); 623 extension_prefs_->OnExtensionInstalled(extension);
637 624
638 // If the extension is a theme, tell the profile (and therefore ThemeProvider) 625 // If the extension is a theme, tell the profile (and therefore ThemeProvider)
639 // to apply it. 626 // to apply it.
640 if (extension->IsTheme()) { 627 if (extension->IsTheme()) {
641 NotificationService::current()->Notify( 628 NotificationService::current()->Notify(
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 955
969 void ExtensionsServiceBackend::OnExternalExtensionFound( 956 void ExtensionsServiceBackend::OnExternalExtensionFound(
970 const std::string& id, const Version* version, const FilePath& path, 957 const std::string& id, const Version* version, const FilePath& path,
971 Extension::Location location) { 958 Extension::Location location) {
972 ChromeThread::PostTask( 959 ChromeThread::PostTask(
973 ChromeThread::UI, FROM_HERE, 960 ChromeThread::UI, FROM_HERE,
974 NewRunnableMethod( 961 NewRunnableMethod(
975 frontend_, &ExtensionsService::OnExternalExtensionFound, id, 962 frontend_, &ExtensionsService::OnExternalExtensionFound, id,
976 version->GetString(), path, location)); 963 version->GetString(), path, location));
977 } 964 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698