| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_USER_IMAGE_SOURCE2_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_USER_IMAGE_SOURCE2_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_USER_IMAGE_SOURCE2_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_USER_IMAGE_SOURCE2_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class UserImageSource : public ChromeURLDataManager::DataSource { | 21 class UserImageSource : public ChromeURLDataManager::DataSource { |
| 22 public: | 22 public: |
| 23 UserImageSource(); | 23 UserImageSource(); |
| 24 | 24 |
| 25 // Called when the network layer has requested a resource underneath | 25 // Called when the network layer has requested a resource underneath |
| 26 // the path we registered. | 26 // the path we registered. |
| 27 virtual void StartDataRequest(const std::string& path, | 27 virtual void StartDataRequest(const std::string& path, |
| 28 bool is_incognito, | 28 bool is_incognito, |
| 29 int request_id) OVERRIDE; | 29 int request_id) OVERRIDE; |
| 30 | 30 |
| 31 virtual std::string GetMimeType(const std::string&) const OVERRIDE; | 31 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; |
| 32 | 32 |
| 33 // Returns PNG encoded image for user with specified email. | 33 // Returns PNG or GIF (when possible and if |is_image_animated| flag |
| 34 // If there's no user with such email, returns the default image. | 34 // is true) encoded image for user with specified email. If there's |
| 35 std::vector<unsigned char> GetUserImage(const std::string& email) const; | 35 // no user with such email, returns the default image. |
| 36 std::vector<unsigned char> GetUserImage(const std::string& email, |
| 37 bool is_image_animated) const; |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 virtual ~UserImageSource(); | 40 virtual ~UserImageSource(); |
| 39 | 41 |
| 40 DISALLOW_COPY_AND_ASSIGN(UserImageSource); | 42 DISALLOW_COPY_AND_ASSIGN(UserImageSource); |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 } // namespace options2 | 45 } // namespace options2 |
| 44 } // namespace chromeos | 46 } // namespace chromeos |
| 45 | 47 |
| 46 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_USER_IMAGE_SOURCE2_H_ | 48 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_USER_IMAGE_SOURCE2_H_ |
| OLD | NEW |