OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 PendingExtensionMap::iterator it = pending_extensions_.find(id); | 776 PendingExtensionMap::iterator it = pending_extensions_.find(id); |
777 if (it != pending_extensions_.end()) { | 777 if (it != pending_extensions_.end()) { |
778 VLOG(1) << "Extension id " << id | 778 VLOG(1) << "Extension id " << id |
779 << " was entered for update more than once." | 779 << " was entered for update more than once." |
780 << " old is_from_sync = " << it->second.is_from_sync | 780 << " old is_from_sync = " << it->second.is_from_sync |
781 << " new is_from_sync = " << is_from_sync; | 781 << " new is_from_sync = " << is_from_sync; |
782 if (!it->second.is_from_sync && is_from_sync) | 782 if (!it->second.is_from_sync && is_from_sync) |
783 return; | 783 return; |
784 } | 784 } |
785 | 785 |
786 | |
787 pending_extensions_[id] = | 786 pending_extensions_[id] = |
788 PendingExtensionInfo(update_url, expected_crx_type, is_from_sync, | 787 PendingExtensionInfo(update_url, expected_crx_type, is_from_sync, |
789 install_silently, enable_on_install, | 788 install_silently, enable_on_install, |
790 enable_incognito_on_install, install_source); | 789 enable_incognito_on_install, install_source); |
791 } | 790 } |
792 | 791 |
793 void ExtensionsService::ReloadExtension(const std::string& extension_id) { | 792 void ExtensionsService::ReloadExtension(const std::string& extension_id) { |
794 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 793 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
795 FilePath path; | 794 FilePath path; |
796 const Extension* current_extension = GetExtensionById(extension_id, false); | 795 const Extension* current_extension = GetExtensionById(extension_id, false); |
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1933 return; | 1932 return; |
1934 case 1: // existing version is newer, uh-oh | 1933 case 1: // existing version is newer, uh-oh |
1935 LOG(WARNING) << "Found external version of extension " << id | 1934 LOG(WARNING) << "Found external version of extension " << id |
1936 << "that is older than current version. Current version " | 1935 << "that is older than current version. Current version " |
1937 << "is: " << existing->VersionString() << ". New version " | 1936 << "is: " << existing->VersionString() << ". New version " |
1938 << "is: " << version << ". Keeping current version."; | 1937 << "is: " << version << ". Keeping current version."; |
1939 return; | 1938 return; |
1940 } | 1939 } |
1941 } | 1940 } |
1942 | 1941 |
| 1942 GURL update_url = GURL(); |
| 1943 PendingExtensionInfo::ExpectedCrxType expected_crx_type = |
| 1944 PendingExtensionInfo::UNKNOWN; |
| 1945 bool is_from_sync = false; |
| 1946 bool install_silently = true; |
| 1947 bool enable_on_install = true; |
| 1948 bool enable_incognito_on_install = false; |
| 1949 pending_extensions_[id] = PendingExtensionInfo( |
| 1950 update_url, |
| 1951 expected_crx_type, |
| 1952 is_from_sync, |
| 1953 install_silently, |
| 1954 enable_on_install, |
| 1955 enable_incognito_on_install, |
| 1956 location); |
| 1957 |
1943 scoped_refptr<CrxInstaller> installer( | 1958 scoped_refptr<CrxInstaller> installer( |
1944 new CrxInstaller(this, // frontend | 1959 new CrxInstaller(this, // frontend |
1945 NULL)); // no client (silent install) | 1960 NULL)); // no client (silent install) |
1946 installer->set_install_source(location); | 1961 installer->set_install_source(location); |
1947 installer->set_expected_id(id); | 1962 installer->set_expected_id(id); |
1948 installer->InstallCrx(path); | 1963 installer->InstallCrx(path); |
1949 } | 1964 } |
1950 | 1965 |
1951 void ExtensionsService::ReportExtensionLoadError( | 1966 void ExtensionsService::ReportExtensionLoadError( |
1952 const FilePath& extension_path, | 1967 const FilePath& extension_path, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2054 } | 2069 } |
2055 | 2070 |
2056 void ExtensionsService::SetBeingUpgraded(const Extension* extension, | 2071 void ExtensionsService::SetBeingUpgraded(const Extension* extension, |
2057 bool value) { | 2072 bool value) { |
2058 extension_runtime_data_[extension->id()].being_upgraded = value; | 2073 extension_runtime_data_[extension->id()].being_upgraded = value; |
2059 } | 2074 } |
2060 | 2075 |
2061 PropertyBag* ExtensionsService::GetPropertyBag(const Extension* extension) { | 2076 PropertyBag* ExtensionsService::GetPropertyBag(const Extension* extension) { |
2062 return &extension_runtime_data_[extension->id()].property_bag; | 2077 return &extension_runtime_data_[extension->id()].property_bag; |
2063 } | 2078 } |
OLD | NEW |