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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 return false; | 531 return false; |
532 } | 532 } |
533 const user_manager::User* user = user_manager->FindUser(user_id); | 533 const user_manager::User* user = user_manager->FindUser(user_id); |
534 bool not_used = false; | 534 bool not_used = false; |
535 if (!user) { | 535 if (!user) { |
536 not_used = true; | 536 not_used = true; |
537 } else if (user->is_logged_in()) { | 537 } else if (user->is_logged_in()) { |
538 // For logged in user also check that this path is actually used as | 538 // For logged in user also check that this path is actually used as |
539 // installed extension or as delayed install. | 539 // installed extension or as delayed install. |
540 Profile* profile = | 540 Profile* profile = |
541 chromeos::ProfileHelper::Get()->GetProfileByUser(user); | 541 chromeos::ProfileHelper::Get()->GetProfileByUserUnsafe(user); |
542 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile); | 542 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile); |
543 if (!extension_prefs || extension_prefs->pref_service()->ReadOnly()) | 543 if (!extension_prefs || extension_prefs->pref_service()->ReadOnly()) |
544 return false; | 544 return false; |
545 | 545 |
546 scoped_ptr<ExtensionInfo> info = | 546 scoped_ptr<ExtensionInfo> info = |
547 extension_prefs->GetInstalledExtensionInfo(id); | 547 extension_prefs->GetInstalledExtensionInfo(id); |
548 if (!info || info->extension_path != base::FilePath(shared_path)) { | 548 if (!info || info->extension_path != base::FilePath(shared_path)) { |
549 info = extension_prefs->GetDelayedInstallInfo(id); | 549 info = extension_prefs->GetDelayedInstallInfo(id); |
550 if (!info || info->extension_path != base::FilePath(shared_path)) { | 550 if (!info || info->extension_path != base::FilePath(shared_path)) { |
551 not_used = true; | 551 not_used = true; |
(...skipping 14 matching lines...) Expand all 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 |