Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / chrome / browser / ui / webui / options / chromeos / user_image_source.h
blobad11d6ada99bf08677de41ef81aee63083e5e448
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_USER_IMAGE_SOURCE_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_USER_IMAGE_SOURCE_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "content/public/browser/url_data_source.h"
14 #include "ui/base/layout.h"
16 namespace base {
17 class RefCountedMemory;
20 namespace chromeos {
21 namespace options {
23 // UserImageSource is the data source that serves user images for users that
24 // have it.
25 class UserImageSource : public content::URLDataSource {
26 public:
27 UserImageSource();
29 // content::URLDataSource implementation.
30 std::string GetSource() const override;
31 void StartDataRequest(
32 const std::string& path,
33 int render_process_id,
34 int render_frame_id,
35 const content::URLDataSource::GotDataCallback& callback) override;
36 std::string GetMimeType(const std::string& path) const override;
38 // Returns PNG encoded image for user with specified email. If there's
39 // no user with such email, returns the first default image.
40 static base::RefCountedMemory* GetUserImage(const std::string& email,
41 ui::ScaleFactor scale_factor);
43 private:
44 ~UserImageSource() override;
46 DISALLOW_COPY_AND_ASSIGN(UserImageSource);
49 } // namespace options
50 } // namespace chromeos
52 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_USER_IMAGE_SOURCE_H_