| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 static base::LazyInstance<Whitelist> | 53 static base::LazyInstance<Whitelist> |
| 54 g_whitelisted_install_data(base::LINKER_INITIALIZED); | 54 g_whitelisted_install_data(base::LINKER_INITIALIZED); |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 CrxInstaller::WhitelistEntry::WhitelistEntry() | 58 CrxInstaller::WhitelistEntry::WhitelistEntry() |
| 59 : use_app_installed_bubble(false) {} | 59 : use_app_installed_bubble(false) {} |
| 60 CrxInstaller::WhitelistEntry::~WhitelistEntry() {} | 60 CrxInstaller::WhitelistEntry::~WhitelistEntry() {} |
| 61 | 61 |
| 62 // static | 62 // static |
| 63 scoped_refptr<CrxInstaller> CrxInstaller::Create( |
| 64 ExtensionService* frontend, |
| 65 ExtensionInstallUI* client) { |
| 66 return new CrxInstaller(frontend->AsWeakPtr(), client); |
| 67 } |
| 68 |
| 69 // static |
| 63 void CrxInstaller::SetWhitelistedInstallId(const std::string& id) { | 70 void CrxInstaller::SetWhitelistedInstallId(const std::string& id) { |
| 64 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 71 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 65 g_whitelisted_install_data.Get().ids.insert(id); | 72 g_whitelisted_install_data.Get().ids.insert(id); |
| 66 } | 73 } |
| 67 | 74 |
| 68 // static | 75 // static |
| 69 void CrxInstaller::SetWhitelistEntry(const std::string& id, | 76 void CrxInstaller::SetWhitelistEntry(const std::string& id, |
| 70 CrxInstaller::WhitelistEntry* entry) { | 77 CrxInstaller::WhitelistEntry* entry) { |
| 71 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 78 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 72 Whitelist& data = g_whitelisted_install_data.Get(); | 79 Whitelist& data = g_whitelisted_install_data.Get(); |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 // 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 |
| 594 // CRXInstaller is done. Listening for the EXTENSION_* events | 601 // CRXInstaller is done. Listening for the EXTENSION_* events |
| 595 // is problematic because they don't know anything about the | 602 // is problematic because they don't know anything about the |
| 596 // extension before it is unpacked, so they can not filter based | 603 // extension before it is unpacked, so they can not filter based |
| 597 // on the extension. | 604 // on the extension. |
| 598 content::NotificationService::current()->Notify( | 605 content::NotificationService::current()->Notify( |
| 599 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 606 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 600 content::Source<CrxInstaller>(this), | 607 content::Source<CrxInstaller>(this), |
| 601 content::NotificationService::NoDetails()); | 608 content::NotificationService::NoDetails()); |
| 602 } | 609 } |
| OLD | NEW |