| 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 476 |
| 477 void UserImageManagerImpl::Job::UpdateLocalState() { | 477 void UserImageManagerImpl::Job::UpdateLocalState() { |
| 478 // Ignore if data stored or cached outside the user's cryptohome is to be | 478 // Ignore if data stored or cached outside the user's cryptohome is to be |
| 479 // treated as ephemeral. | 479 // treated as ephemeral. |
| 480 if (parent_->user_manager_->IsUserNonCryptohomeDataEphemeral( | 480 if (parent_->user_manager_->IsUserNonCryptohomeDataEphemeral( |
| 481 AccountId::FromUserEmail(user_id()))) | 481 AccountId::FromUserEmail(user_id()))) |
| 482 return; | 482 return; |
| 483 | 483 |
| 484 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); | 484 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); |
| 485 entry->Set(kImagePathNodeName, new base::StringValue(image_path_.value())); | 485 entry->Set(kImagePathNodeName, new base::StringValue(image_path_.value())); |
| 486 entry->Set(kImageIndexNodeName, new base::FundamentalValue(image_index_)); | 486 entry->Set(kImageIndexNodeName, new base::Value(image_index_)); |
| 487 if (!image_url_.is_empty()) | 487 if (!image_url_.is_empty()) |
| 488 entry->Set(kImageURLNodeName, new base::StringValue(image_url_.spec())); | 488 entry->Set(kImageURLNodeName, new base::StringValue(image_url_.spec())); |
| 489 DictionaryPrefUpdate update(g_browser_process->local_state(), | 489 DictionaryPrefUpdate update(g_browser_process->local_state(), |
| 490 kUserImageProperties); | 490 kUserImageProperties); |
| 491 update->SetWithoutPathExpansion(user_id(), entry.release()); | 491 update->SetWithoutPathExpansion(user_id(), entry.release()); |
| 492 | 492 |
| 493 parent_->user_manager_->NotifyLocalStateChanged(); | 493 parent_->user_manager_->NotifyLocalStateChanged(); |
| 494 } | 494 } |
| 495 | 495 |
| 496 void UserImageManagerImpl::Job::NotifyJobDone() { | 496 void UserImageManagerImpl::Job::NotifyJobDone() { |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 } | 963 } |
| 964 | 964 |
| 965 bool UserImageManagerImpl::IsUserLoggedInAndHasGaiaAccount() const { | 965 bool UserImageManagerImpl::IsUserLoggedInAndHasGaiaAccount() const { |
| 966 const user_manager::User* user = GetUser(); | 966 const user_manager::User* user = GetUser(); |
| 967 if (!user) | 967 if (!user) |
| 968 return false; | 968 return false; |
| 969 return user->is_logged_in() && user->HasGaiaAccount(); | 969 return user->is_logged_in() && user->HasGaiaAccount(); |
| 970 } | 970 } |
| 971 | 971 |
| 972 } // namespace chromeos | 972 } // namespace chromeos |
| OLD | NEW |