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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/user_image_source.cc

Issue 2529103002: Add account_type into AccountId (Closed)
Patch Set: Fix MultiUserWindowManagerChromeOSTest.* Created 4 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/options/chromeos/user_image_source.h" 5 #include "chrome/browser/ui/webui/options/chromeos/user_image_source.h"
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im ages.h" 10 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im ages.h"
(...skipping 20 matching lines...) Expand all
31 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS | 31 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS |
32 net::UnescapeRule::PATH_SEPARATORS | net::UnescapeRule::SPACES); 32 net::UnescapeRule::PATH_SEPARATORS | net::UnescapeRule::SPACES);
33 AccountId account_id(EmptyAccountId()); 33 AccountId account_id(EmptyAccountId());
34 const bool status = 34 const bool status =
35 AccountId::Deserialize(serialized_account_id, &account_id); 35 AccountId::Deserialize(serialized_account_id, &account_id);
36 // TODO(alemate): DCHECK(status) - should happen after options page is 36 // TODO(alemate): DCHECK(status) - should happen after options page is
37 // migrated. 37 // migrated.
38 if (!status) { 38 if (!status) {
39 LOG(WARNING) << "Failed to deserialize account_id."; 39 LOG(WARNING) << "Failed to deserialize account_id.";
40 account_id = user_manager::known_user::GetAccountId( 40 account_id = user_manager::known_user::GetAccountId(
41 serialized_account_id, std::string() /* gaia_id */); 41 serialized_account_id, std::string() /* id */, AccountType::UNKNOWN);
42 } 42 }
43 *email = account_id.GetUserEmail(); 43 *email = account_id.GetUserEmail();
44 } 44 }
45 45
46 scoped_refptr<base::RefCountedMemory> GetUserImageInternal( 46 scoped_refptr<base::RefCountedMemory> GetUserImageInternal(
47 const AccountId& account_id) { 47 const AccountId& account_id) {
48 const user_manager::User* user = 48 const user_manager::User* user =
49 user_manager::UserManager::Get()->FindUser(account_id); 49 user_manager::UserManager::Get()->FindUser(account_id);
50 50
51 // Always use the 100% scaling. These source images are 256x256, and are 51 // Always use the 100% scaling. These source images are 256x256, and are
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 103 }
104 104
105 std::string UserImageSource::GetMimeType(const std::string& path) const { 105 std::string UserImageSource::GetMimeType(const std::string& path) const {
106 // We need to explicitly return a mime type, otherwise if the user tries to 106 // We need to explicitly return a mime type, otherwise if the user tries to
107 // drag the image they get no extension. 107 // drag the image they get no extension.
108 return "image/png"; 108 return "image/png";
109 } 109 }
110 110
111 } // namespace options 111 } // namespace options
112 } // namespace chromeos 112 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc ('k') | chromeos/cryptohome/cryptohome_parameters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698