OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/passwords/manage_passwords_view_utils.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 return gfx::ImageSkiaOperations::CreateResizedImage( | 50 return gfx::ImageSkiaOperations::CreateResizedImage( |
51 skia_image, | 51 skia_image, |
52 skia::ImageOperations::RESIZE_BEST, | 52 skia::ImageOperations::RESIZE_BEST, |
53 gfx::Size(kAvatarImageSize, kAvatarImageSize)); | 53 gfx::Size(kAvatarImageSize, kAvatarImageSize)); |
54 } | 54 } |
55 | 55 |
56 std::pair<base::string16, base::string16> GetCredentialLabelsForAccountChooser( | 56 std::pair<base::string16, base::string16> GetCredentialLabelsForAccountChooser( |
57 const autofill::PasswordForm& form) { | 57 const autofill::PasswordForm& form) { |
58 base::string16 federation; | 58 base::string16 federation; |
59 if (!form.federation_origin.unique()) { | 59 if (!form.federation_origin.opaque()) { |
60 federation = l10n_util::GetStringFUTF16( | 60 federation = l10n_util::GetStringFUTF16( |
61 IDS_PASSWORDS_VIA_FEDERATION, | 61 IDS_PASSWORDS_VIA_FEDERATION, |
62 base::UTF8ToUTF16(form.federation_origin.host())); | 62 base::UTF8ToUTF16(form.federation_origin.host())); |
63 } | 63 } |
64 | 64 |
65 if (form.display_name.empty()) | 65 if (form.display_name.empty()) |
66 return std::make_pair(form.username_value, std::move(federation)); | 66 return std::make_pair(form.username_value, std::move(federation)); |
67 | 67 |
68 // Display name isn't empty. | 68 // Display name isn't empty. |
69 if (federation.empty()) | 69 if (federation.empty()) |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 : form.username_value; | 187 : form.username_value; |
188 } | 188 } |
189 | 189 |
190 bool IsSyncingAutosignSetting(Profile* profile) { | 190 bool IsSyncingAutosignSetting(Profile* profile) { |
191 const browser_sync::ProfileSyncService* sync_service = | 191 const browser_sync::ProfileSyncService* sync_service = |
192 ProfileSyncServiceFactory::GetForProfile(profile); | 192 ProfileSyncServiceFactory::GetForProfile(profile); |
193 return (sync_service && sync_service->IsFirstSetupComplete() && | 193 return (sync_service && sync_service->IsFirstSetupComplete() && |
194 sync_service->IsSyncActive() && | 194 sync_service->IsSyncActive() && |
195 sync_service->GetActiveDataTypes().Has(syncer::PRIORITY_PREFERENCES)); | 195 sync_service->GetActiveDataTypes().Has(syncer::PRIORITY_PREFERENCES)); |
196 } | 196 } |
OLD | NEW |