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

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

Issue 974713002: kiosk: Ensure launching latest version. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittest compile Created 5 years, 9 months 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 const std::string& id) const { 2100 const std::string& id) const {
2101 return registry_->GetExtensionById(id, ExtensionRegistry::EVERYTHING); 2101 return registry_->GetExtensionById(id, ExtensionRegistry::EVERYTHING);
2102 } 2102 }
2103 2103
2104 bool ExtensionService::OnExternalExtensionFileFound( 2104 bool ExtensionService::OnExternalExtensionFileFound(
2105 const std::string& id, 2105 const std::string& id,
2106 const Version* version, 2106 const Version* version,
2107 const base::FilePath& path, 2107 const base::FilePath& path,
2108 Manifest::Location location, 2108 Manifest::Location location,
2109 int creation_flags, 2109 int creation_flags,
2110 bool mark_acknowledged) { 2110 bool mark_acknowledged,
2111 bool install_immediately) {
2111 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 2112 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
2112 CHECK(crx_file::id_util::IdIsValid(id)); 2113 CHECK(crx_file::id_util::IdIsValid(id));
2113 if (extension_prefs_->IsExternalExtensionUninstalled(id)) 2114 if (extension_prefs_->IsExternalExtensionUninstalled(id))
2114 return false; 2115 return false;
2115 2116
2116 // Before even bothering to unpack, check and see if we already have this 2117 // Before even bothering to unpack, check and see if we already have this
2117 // version. This is important because these extensions are going to get 2118 // version. This is important because these extensions are going to get
2118 // installed on every startup. 2119 // installed on every startup.
2119 const Extension* existing = GetExtensionById(id, true); 2120 const Extension* existing = GetExtensionById(id, true);
2120 2121
(...skipping 30 matching lines...) Expand all
2151 id, location, *version, creation_flags, mark_acknowledged)) { 2152 id, location, *version, creation_flags, mark_acknowledged)) {
2152 return false; 2153 return false;
2153 } 2154 }
2154 2155
2155 // no client (silent install) 2156 // no client (silent install)
2156 scoped_refptr<CrxInstaller> installer(CrxInstaller::CreateSilent(this)); 2157 scoped_refptr<CrxInstaller> installer(CrxInstaller::CreateSilent(this));
2157 installer->set_install_source(location); 2158 installer->set_install_source(location);
2158 installer->set_expected_id(id); 2159 installer->set_expected_id(id);
2159 installer->set_expected_version(*version); 2160 installer->set_expected_version(*version);
2160 installer->set_install_cause(extension_misc::INSTALL_CAUSE_EXTERNAL_FILE); 2161 installer->set_install_cause(extension_misc::INSTALL_CAUSE_EXTERNAL_FILE);
2162 installer->set_install_immediately(install_immediately);
2161 installer->set_creation_flags(creation_flags); 2163 installer->set_creation_flags(creation_flags);
2162 #if defined(OS_CHROMEOS) 2164 #if defined(OS_CHROMEOS)
2163 extensions::InstallLimiter::Get(profile_)->Add(installer, path); 2165 extensions::InstallLimiter::Get(profile_)->Add(installer, path);
2164 #else 2166 #else
2165 installer->InstallCrx(path); 2167 installer->InstallCrx(path);
2166 #endif 2168 #endif
2167 2169
2168 // Depending on the source, a new external extension might not need a user 2170 // Depending on the source, a new external extension might not need a user
2169 // notification on installation. For such extensions, mark them acknowledged 2171 // notification on installation. For such extensions, mark them acknowledged
2170 // now to suppress the notification. 2172 // now to suppress the notification.
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
2555 } 2557 }
2556 2558
2557 void ExtensionService::OnProfileDestructionStarted() { 2559 void ExtensionService::OnProfileDestructionStarted() {
2558 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2560 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2559 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2561 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2560 it != ids_to_unload.end(); 2562 it != ids_to_unload.end();
2561 ++it) { 2563 ++it) {
2562 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2564 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2563 } 2565 }
2564 } 2566 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698