15f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 25f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// found in the LICENSE file. 45f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 55f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#ifndef COMPONENTS_USER_MANAGER_USER_IMAGE_DEFAULT_USER_IMAGES_H_ 65f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#define COMPONENTS_USER_MANAGER_USER_IMAGE_DEFAULT_USER_IMAGES_H_ 75f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 85f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include <cstddef> // for size_t 95f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include <string> 105f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 115f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "base/strings/string16.h" 125f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "components/user_manager/user_manager_export.h" 135f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 145f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace gfx { 155f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class ImageSkia; 165f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)} 175f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 185f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace user_manager { 195f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 205f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Returns URL to default user image with specified index. 215f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT std::string GetDefaultImageUrl(int index); 225f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 235f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Checks if the given URL points to one of the default images. If it is, 245f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// returns true and its index through |image_id|. If not, returns false. 255f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT bool IsDefaultImageUrl(const std::string& url, 265f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) int* image_id); 275f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 285f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Returns bitmap of default user image with specified index. 295f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT const gfx::ImageSkia& GetDefaultImage(int index); 305f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 315f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Returns a description of a default user image with specified index. 325f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT base::string16 GetDefaultImageDescription(int index); 335f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 345f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Resource IDs of default user images. 355f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kDefaultImageResourceIDs[]; 365f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 375f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// String IDs of author names for default user images. 385f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kDefaultImageAuthorIDs[]; 395f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 405f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// String IDs of websites for default user images. 415f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kDefaultImageWebsiteIDs[]; 425f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 435f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Number of default images. 445f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kDefaultImagesCount; 455f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 465f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// The starting index of default images available for selection. Note that 475f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// existing users may have images with smaller indices. 485f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kFirstDefaultImageIndex; 495f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 505f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)/// Histogram values. //////////////////////////////////////////////////////// 515f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 525f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Histogram value for user image taken from file. 535f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kHistogramImageFromFile; 545f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 555f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Histogram value for user image taken from camera. 565f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kHistogramImageFromCamera; 575f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 585f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Histogram value a previously used image from camera/file. 595f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kHistogramImageOld; 605f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 615f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Histogram value for user image from G+ profile. 625f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kHistogramImageFromProfile; 635f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 645f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Histogram value for user video (animated avatar) from camera. 655f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kHistogramVideoFromCamera; 665f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 675f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Histogram value for user video from file. 685f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kHistogramVideoFromFile; 695f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 705f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Number of possible histogram values for user images. 715f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT extern const int kHistogramImagesCount; 725f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 735f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Returns the histogram value corresponding to the given default image index. 745f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)USER_MANAGER_EXPORT int GetDefaultImageHistogramValue(int index); 755f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 765f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)} // namespace user_manager 775f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 785f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#endif // COMPONENTS_USER_MANAGER_USER_IMAGE_DEFAULT_USER_IMAGES_H_ 79