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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 // Checks whether two URLs are from the same domain or host. | 33 // Checks whether two URLs are from the same domain or host. |
34 bool SameDomainOrHost(const GURL& gurl1, const GURL& gurl2) { | 34 bool SameDomainOrHost(const GURL& gurl1, const GURL& gurl2) { |
35 return net::registry_controlled_domains::SameDomainOrHost( | 35 return net::registry_controlled_domains::SameDomainOrHost( |
36 gurl1, gurl2, | 36 gurl1, gurl2, |
37 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); | 37 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
38 } | 38 } |
39 | 39 |
40 } // namespace | 40 } // namespace |
41 | 41 |
42 const int kAvatarImageSize = 32; | |
43 | |
44 gfx::ImageSkia ScaleImageForAccountAvatar(gfx::ImageSkia skia_image) { | 42 gfx::ImageSkia ScaleImageForAccountAvatar(gfx::ImageSkia skia_image) { |
45 gfx::Size size = skia_image.size(); | 43 gfx::Size size = skia_image.size(); |
46 if (size.height() != size.width()) { | 44 if (size.height() != size.width()) { |
47 gfx::Rect target(size); | 45 gfx::Rect target(size); |
48 int side = std::min(size.height(), size.width()); | 46 int side = std::min(size.height(), size.width()); |
49 target.ClampToCenteredSize(gfx::Size(side, side)); | 47 target.ClampToCenteredSize(gfx::Size(side, side)); |
50 skia_image = gfx::ImageSkiaOperations::ExtractSubset(skia_image, target); | 48 skia_image = gfx::ImageSkiaOperations::ExtractSubset(skia_image, target); |
51 } | 49 } |
52 return gfx::ImageSkiaOperations::CreateResizedImage( | 50 return gfx::ImageSkiaOperations::CreateResizedImage( |
53 skia_image, | 51 skia_image, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 : form.username_value; | 177 : form.username_value; |
180 } | 178 } |
181 | 179 |
182 bool IsSyncingAutosignSetting(Profile* profile) { | 180 bool IsSyncingAutosignSetting(Profile* profile) { |
183 const ProfileSyncService* sync_service = | 181 const ProfileSyncService* sync_service = |
184 ProfileSyncServiceFactory::GetForProfile(profile); | 182 ProfileSyncServiceFactory::GetForProfile(profile); |
185 return (sync_service && sync_service->IsFirstSetupComplete() && | 183 return (sync_service && sync_service->IsFirstSetupComplete() && |
186 sync_service->IsSyncActive() && | 184 sync_service->IsSyncActive() && |
187 sync_service->GetActiveDataTypes().Has(syncer::PRIORITY_PREFERENCES)); | 185 sync_service->GetActiveDataTypes().Has(syncer::PRIORITY_PREFERENCES)); |
188 } | 186 } |
OLD | NEW |