Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / screenlock_icon_source.h
blob3d4bdf60a70cb6a0700cfb73134893f5456c544b
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 virtual std::string GetSource() const OVERRIDE;
23 virtual 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 virtual 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 virtual ~ScreenlockIconSource();
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_