Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / screenlock_icon_source.h
blob87bf4907830f3cee16e03f7145c34309d031b542
1 // Copyright 2013 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_CHROMEOS_LOGIN_SCREENLOCK_ICON_SOURCE_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_SOURCE_H_
8 #include "base/memory/weak_ptr.h"
9 #include "content/public/browser/url_data_source.h"
11 namespace chromeos {
13 class ScreenlockIconProvider;
15 // A URL data source that serves icon images for the screenlockPrivate API.
16 class ScreenlockIconSource : public content::URLDataSource {
17 public:
18 explicit ScreenlockIconSource(
19 base::WeakPtr<ScreenlockIconProvider> icon_provider);
21 // content::URLDataSource implementation.
22 std::string GetSource() const override;
23 void StartDataRequest(
24 const std::string& path,
25 int render_process_id,
26 int render_frame_id,
27 const content::URLDataSource::GotDataCallback& callback) override;
29 std::string GetMimeType(const std::string& path) const override;
31 // Constructs and returns the icon URL for a given user.
32 static std::string GetIconURLForUser(const std::string& username);
34 private:
35 ~ScreenlockIconSource() override;
37 base::WeakPtr<ScreenlockIconProvider> icon_provider_;
39 DISALLOW_COPY_AND_ASSIGN(ScreenlockIconSource);
42 } // namespace chromeos
44 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_SOURCE_H_