OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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_assets_manager_chromeos.h" | 5 #include "chrome/browser/extensions/extension_assets_manager_chromeos.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 void ExtensionAssetsManagerChromeOS::CheckSharedExtension( | 274 void ExtensionAssetsManagerChromeOS::CheckSharedExtension( |
275 const std::string& id, | 275 const std::string& id, |
276 const std::string& version, | 276 const std::string& version, |
277 const base::FilePath& unpacked_extension_root, | 277 const base::FilePath& unpacked_extension_root, |
278 const base::FilePath& local_install_dir, | 278 const base::FilePath& local_install_dir, |
279 Profile* profile, | 279 Profile* profile, |
280 InstallExtensionCallback callback) { | 280 InstallExtensionCallback callback) { |
281 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 281 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
282 | 282 |
283 const std::string& user_id = profile->GetProfileName(); | 283 const std::string& user_id = profile->GetProfileName(); |
284 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 284 chromeos::UserManager* user_manager = chromeos::GetUserManager(); |
285 if (!user_manager) { | 285 if (!user_manager) { |
286 NOTREACHED(); | 286 NOTREACHED(); |
287 return; | 287 return; |
288 } | 288 } |
289 | 289 |
290 if (user_manager->IsUserNonCryptohomeDataEphemeral(user_id) || | 290 if (user_manager->IsUserNonCryptohomeDataEphemeral(user_id) || |
291 !user_manager->IsLoggedInAsRegularUser()) { | 291 !user_manager->IsLoggedInAsRegularUser()) { |
292 // Don't cache anything in shared location for ephemeral user or special | 292 // Don't cache anything in shared location for ephemeral user or special |
293 // user types. | 293 // user types. |
294 ExtensionAssetsManagerChromeOS::GetFileTaskRunner(profile)->PostTask( | 294 ExtensionAssetsManagerChromeOS::GetFileTaskRunner(profile)->PostTask( |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 const base::FilePath& shared_version_dir) { | 490 const base::FilePath& shared_version_dir) { |
491 CHECK(GetSharedInstallDir().IsParent(shared_version_dir)); | 491 CHECK(GetSharedInstallDir().IsParent(shared_version_dir)); |
492 base::DeleteFile(shared_version_dir, true); // recursive. | 492 base::DeleteFile(shared_version_dir, true); // recursive. |
493 } | 493 } |
494 | 494 |
495 // static | 495 // static |
496 bool ExtensionAssetsManagerChromeOS::CleanUpExtension( | 496 bool ExtensionAssetsManagerChromeOS::CleanUpExtension( |
497 const std::string& id, | 497 const std::string& id, |
498 base::DictionaryValue* extension_info, | 498 base::DictionaryValue* extension_info, |
499 std::multimap<std::string, base::FilePath>* live_extension_paths) { | 499 std::multimap<std::string, base::FilePath>* live_extension_paths) { |
500 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 500 chromeos::UserManager* user_manager = chromeos::GetUserManager(); |
501 if (!user_manager) { | 501 if (!user_manager) { |
502 NOTREACHED(); | 502 NOTREACHED(); |
503 return false; | 503 return false; |
504 } | 504 } |
505 | 505 |
506 std::vector<std::string> versions; | 506 std::vector<std::string> versions; |
507 versions.reserve(extension_info->size()); | 507 versions.reserve(extension_info->size()); |
508 for (base::DictionaryValue::Iterator it(*extension_info); | 508 for (base::DictionaryValue::Iterator it(*extension_info); |
509 !it.IsAtEnd(); it.Advance()) { | 509 !it.IsAtEnd(); it.Advance()) { |
510 versions.push_back(it.key()); | 510 versions.push_back(it.key()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 std::make_pair(id, base::FilePath(shared_path))); | 566 std::make_pair(id, base::FilePath(shared_path))); |
567 } else { | 567 } else { |
568 extension_info->RemoveWithoutPathExpansion(*it, NULL); | 568 extension_info->RemoveWithoutPathExpansion(*it, NULL); |
569 } | 569 } |
570 } | 570 } |
571 | 571 |
572 return true; | 572 return true; |
573 } | 573 } |
574 | 574 |
575 } // namespace extensions | 575 } // namespace extensions |
OLD | NEW |