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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 547 entry->Set(kImagePathNodeName, |
548 base::MakeUnique<base::Value>(image_path_.value())); | 548 base::MakeUnique<base::Value>(image_path_.value())); |
549 entry->Set(kImageIndexNodeName, base::MakeUnique<base::Value>(image_index_)); | 549 entry->Set(kImageIndexNodeName, base::MakeUnique<base::Value>(image_index_)); |
550 if (!image_url_.is_empty()) | 550 if (!image_url_.is_empty()) |
551 entry->Set(kImageURLNodeName, | 551 entry->Set(kImageURLNodeName, |
552 base::MakeUnique<base::Value>(image_url_.spec())); | 552 base::MakeUnique<base::Value>(image_url_.spec())); |
553 DictionaryPrefUpdate update(g_browser_process->local_state(), | 553 DictionaryPrefUpdate update(g_browser_process->local_state(), |
554 kUserImageProperties); | 554 kUserImageProperties); |
555 update->SetWithoutPathExpansion(user_id(), entry.release()); | 555 update->SetWithoutPathExpansion(user_id(), std::move(entry)); |
556 | 556 |
557 parent_->user_manager_->NotifyLocalStateChanged(); | 557 parent_->user_manager_->NotifyLocalStateChanged(); |
558 } | 558 } |
559 | 559 |
560 void UserImageManagerImpl::Job::NotifyJobDone() { | 560 void UserImageManagerImpl::Job::NotifyJobDone() { |
561 parent_->OnJobDone(); | 561 parent_->OnJobDone(); |
562 } | 562 } |
563 | 563 |
564 UserImageManagerImpl::UserImageManagerImpl( | 564 UserImageManagerImpl::UserImageManagerImpl( |
565 const std::string& user_id, | 565 const std::string& user_id, |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 } | 1022 } |
1023 | 1023 |
1024 bool UserImageManagerImpl::IsUserLoggedInAndHasGaiaAccount() const { | 1024 bool UserImageManagerImpl::IsUserLoggedInAndHasGaiaAccount() const { |
1025 const user_manager::User* user = GetUser(); | 1025 const user_manager::User* user = GetUser(); |
1026 if (!user) | 1026 if (!user) |
1027 return false; | 1027 return false; |
1028 return user->is_logged_in() && user->HasGaiaAccount(); | 1028 return user->is_logged_in() && user->HasGaiaAccount(); |
1029 } | 1029 } |
1030 | 1030 |
1031 } // namespace chromeos | 1031 } // namespace chromeos |
OLD | NEW |