| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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/chromeos/login/users/avatar/user_image_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 538 |
| 539 void UserImageManagerImpl::Job::UpdateLocalState() { | 539 void UserImageManagerImpl::Job::UpdateLocalState() { |
| 540 // Ignore if data stored or cached outside the user's cryptohome is to be | 540 // Ignore if data stored or cached outside the user's cryptohome is to be |
| 541 // treated as ephemeral. | 541 // treated as ephemeral. |
| 542 if (parent_->user_manager_->IsUserNonCryptohomeDataEphemeral( | 542 if (parent_->user_manager_->IsUserNonCryptohomeDataEphemeral( |
| 543 AccountId::FromUserEmail(user_id()))) | 543 AccountId::FromUserEmail(user_id()))) |
| 544 return; | 544 return; |
| 545 | 545 |
| 546 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); | 546 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); |
| 547 entry->Set(kImagePathNodeName, new base::StringValue(image_path_.value())); | 547 entry->Set(kImagePathNodeName, new base::StringValue(image_path_.value())); |
| 548 entry->Set(kImageIndexNodeName, new base::FundamentalValue(image_index_)); | 548 entry->Set(kImageIndexNodeName, new base::Value(image_index_)); |
| 549 if (!image_url_.is_empty()) | 549 if (!image_url_.is_empty()) |
| 550 entry->Set(kImageURLNodeName, new base::StringValue(image_url_.spec())); | 550 entry->Set(kImageURLNodeName, new base::StringValue(image_url_.spec())); |
| 551 DictionaryPrefUpdate update(g_browser_process->local_state(), | 551 DictionaryPrefUpdate update(g_browser_process->local_state(), |
| 552 kUserImageProperties); | 552 kUserImageProperties); |
| 553 update->SetWithoutPathExpansion(user_id(), entry.release()); | 553 update->SetWithoutPathExpansion(user_id(), entry.release()); |
| 554 | 554 |
| 555 parent_->user_manager_->NotifyLocalStateChanged(); | 555 parent_->user_manager_->NotifyLocalStateChanged(); |
| 556 } | 556 } |
| 557 | 557 |
| 558 void UserImageManagerImpl::Job::NotifyJobDone() { | 558 void UserImageManagerImpl::Job::NotifyJobDone() { |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 bool UserImageManagerImpl::IsUserLoggedInAndHasGaiaAccount() const { | 1022 bool UserImageManagerImpl::IsUserLoggedInAndHasGaiaAccount() const { |
| 1023 const user_manager::User* user = GetUser(); | 1023 const user_manager::User* user = GetUser(); |
| 1024 if (!user) | 1024 if (!user) |
| 1025 return false; | 1025 return false; |
| 1026 return user->is_logged_in() && user->HasGaiaAccount(); | 1026 return user->is_logged_in() && user->HasGaiaAccount(); |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 } // namespace chromeos | 1029 } // namespace chromeos |
| OLD | NEW |