OLD | NEW |
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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 } | 544 } |
545 | 545 |
546 void CrxInstaller::ReportSuccessFromFileThread() { | 546 void CrxInstaller::ReportSuccessFromFileThread() { |
547 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 547 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
548 | 548 |
549 // Tracking number of extensions installed by users | 549 // Tracking number of extensions installed by users |
550 if (install_cause() == extension_misc::INSTALL_CAUSE_USER_DOWNLOAD) { | 550 if (install_cause() == extension_misc::INSTALL_CAUSE_USER_DOWNLOAD) { |
551 UMA_HISTOGRAM_ENUMERATION("Extensions.ExtensionInstalled", 1, 2); | 551 UMA_HISTOGRAM_ENUMERATION("Extensions.ExtensionInstalled", 1, 2); |
552 | 552 |
553 static bool default_apps_trial_exists = | 553 static bool default_apps_trial_exists = |
554 base::FieldTrialList::TrialExists(kDefaultAppsTrial_Name); | 554 base::FieldTrialList::TrialExists(kDefaultAppsTrialName); |
555 if (default_apps_trial_exists) { | 555 if (default_apps_trial_exists) { |
556 UMA_HISTOGRAM_ENUMERATION( | 556 UMA_HISTOGRAM_ENUMERATION( |
557 base::FieldTrial::MakeName("Extensions.ExtensionInstalled", | 557 base::FieldTrial::MakeName("Extensions.ExtensionInstalled", |
558 kDefaultAppsTrial_Name), | 558 kDefaultAppsTrialName), |
559 1, 2); | 559 1, 2); |
560 } | 560 } |
561 } | 561 } |
562 | 562 |
563 if (!BrowserThread::PostTask( | 563 if (!BrowserThread::PostTask( |
564 BrowserThread::UI, FROM_HERE, | 564 BrowserThread::UI, FROM_HERE, |
565 base::Bind(&CrxInstaller::ReportSuccessFromUIThread, this))) | 565 base::Bind(&CrxInstaller::ReportSuccessFromUIThread, this))) |
566 NOTREACHED(); | 566 NOTREACHED(); |
567 } | 567 } |
568 | 568 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 // Some users (such as the download shelf) need to know when a | 600 // Some users (such as the download shelf) need to know when a |
601 // CRXInstaller is done. Listening for the EXTENSION_* events | 601 // CRXInstaller is done. Listening for the EXTENSION_* events |
602 // is problematic because they don't know anything about the | 602 // is problematic because they don't know anything about the |
603 // extension before it is unpacked, so they cannot filter based | 603 // extension before it is unpacked, so they cannot filter based |
604 // on the extension. | 604 // on the extension. |
605 content::NotificationService::current()->Notify( | 605 content::NotificationService::current()->Notify( |
606 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 606 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
607 content::Source<CrxInstaller>(this), | 607 content::Source<CrxInstaller>(this), |
608 content::Details<const Extension>(extension)); | 608 content::Details<const Extension>(extension)); |
609 } | 609 } |
OLD | NEW |