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

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

Issue 398753004: [cros] Move User class to user_manager component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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) 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 return false; 523 return false;
524 } 524 }
525 525
526 size_t num_users = users->GetSize(); 526 size_t num_users = users->GetSize();
527 for (size_t i = 0; i < num_users; i++) { 527 for (size_t i = 0; i < num_users; i++) {
528 std::string user_id; 528 std::string user_id;
529 if (!users->GetString(i, &user_id)) { 529 if (!users->GetString(i, &user_id)) {
530 NOTREACHED(); 530 NOTREACHED();
531 return false; 531 return false;
532 } 532 }
533 const chromeos::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()->GetProfileByUser(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())
(...skipping 22 matching lines...) Expand all
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698