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

Side by Side Diff: chrome/browser/chromeos/extensions/external_cache.cc

Issue 271263002: New test cases for kiosk app crx file cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improvement based on comments. Created 6 years, 7 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 | Annotate | Revision Log
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/chromeos/extensions/external_cache.h" 5 #include "chrome/browser/chromeos/extensions/external_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 return; 113 return;
114 114
115 for (size_t i = 0; i < ids.size(); ++i) { 115 for (size_t i = 0; i < ids.size(); ++i) {
116 cached_extensions_->Remove(ids[i], NULL); 116 cached_extensions_->Remove(ids[i], NULL);
117 extensions_->Remove(ids[i], NULL); 117 extensions_->Remove(ids[i], NULL);
118 local_cache_.RemoveExtension(ids[i]); 118 local_cache_.RemoveExtension(ids[i]);
119 } 119 }
120 UpdateExtensionLoader(); 120 UpdateExtensionLoader();
121 } 121 }
122 122
123 bool ExternalCache::GetExtension(const std::string& id,
124 base::FilePath* file_path,
125 std::string* version) {
126 return local_cache_.GetExtension(id, file_path, version);
127 }
128
123 void ExternalCache::Observe(int type, 129 void ExternalCache::Observe(int type,
124 const content::NotificationSource& source, 130 const content::NotificationSource& source,
125 const content::NotificationDetails& details) { 131 const content::NotificationDetails& details) {
126 switch (type) { 132 switch (type) {
127 case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: { 133 case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
128 extensions::CrxInstaller* installer = 134 extensions::CrxInstaller* installer =
129 content::Source<extensions::CrxInstaller>(source).ptr(); 135 content::Source<extensions::CrxInstaller>(source).ptr();
130 OnDamagedFileDetected(installer->source_file()); 136 OnDamagedFileDetected(installer->source_file());
131 break; 137 break;
132 } 138 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 delegate_->OnExtensionLoadedInCache(id); 319 delegate_->OnExtensionLoadedInCache(id);
314 UpdateExtensionLoader(); 320 UpdateExtensionLoader();
315 } 321 }
316 322
317 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( 323 std::string ExternalCache::Delegate::GetInstalledExtensionVersion(
318 const std::string& id) { 324 const std::string& id) {
319 return std::string(); 325 return std::string();
320 } 326 }
321 327
322 } // namespace chromeos 328 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/external_cache.h ('k') | chrome/browser/chromeos/login/kiosk_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698