| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_CHROMEOS_LOGIN_SCREENLOCK_ICON_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_SOURCE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "content/public/browser/url_data_source.h" | 9 #include "content/public/browser/url_data_source.h" |
| 10 | 10 |
| 11 namespace chromeos { | 11 namespace chromeos { |
| 12 | 12 |
| 13 class ScreenlockIconProvider; | 13 class ScreenlockIconProvider; |
| 14 | 14 |
| 15 // A URL data source that serves icon images for the screenlockPrivate API. | 15 // A URL data source that serves icon images for the screenlockPrivate API. |
| 16 class ScreenlockIconSource : public content::URLDataSource { | 16 class ScreenlockIconSource : public content::URLDataSource { |
| 17 public: | 17 public: |
| 18 explicit ScreenlockIconSource( | 18 explicit ScreenlockIconSource( |
| 19 base::WeakPtr<ScreenlockIconProvider> icon_provider); | 19 base::WeakPtr<ScreenlockIconProvider> icon_provider); |
| 20 | 20 |
| 21 // content::URLDataSource implementation. | 21 // content::URLDataSource implementation. |
| 22 virtual std::string GetSource() const OVERRIDE; | 22 virtual std::string GetSource() const override; |
| 23 virtual void StartDataRequest( | 23 virtual void StartDataRequest( |
| 24 const std::string& path, | 24 const std::string& path, |
| 25 int render_process_id, | 25 int render_process_id, |
| 26 int render_frame_id, | 26 int render_frame_id, |
| 27 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; | 27 const content::URLDataSource::GotDataCallback& callback) override; |
| 28 | 28 |
| 29 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; | 29 virtual std::string GetMimeType(const std::string& path) const override; |
| 30 | 30 |
| 31 // Constructs and returns the icon URL for a given user. | 31 // Constructs and returns the icon URL for a given user. |
| 32 static std::string GetIconURLForUser(const std::string& username); | 32 static std::string GetIconURLForUser(const std::string& username); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 virtual ~ScreenlockIconSource(); | 35 virtual ~ScreenlockIconSource(); |
| 36 | 36 |
| 37 base::WeakPtr<ScreenlockIconProvider> icon_provider_; | 37 base::WeakPtr<ScreenlockIconProvider> icon_provider_; |
| 38 | 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(ScreenlockIconSource); | 39 DISALLOW_COPY_AND_ASSIGN(ScreenlockIconSource); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace chromeos | 42 } // namespace chromeos |
| 43 | 43 |
| 44 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_SOURCE_H_ | 44 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_SOURCE_H_ |
| OLD | NEW |