Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / ash / launcher / launcher_favicon_loader.h
blob6327c022c62dac79fde6c99d8334af56c5f5e461
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_ASH_LAUNCHER_LAUNCHER_FAVICON_LOADER_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_FAVICON_LOADER_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "content/public/common/favicon_url.h"
14 class GURL;
15 class SkBitmap;
17 namespace internal {
18 class FaviconBitmapHandler;
21 namespace content {
22 class WebContents;
25 // LauncherFaviconLoader handles updates to the list of favicon urls and
26 // retrieves the appropriately sized favicon for panels in the Launcher.
28 class LauncherFaviconLoader {
29 public:
30 class Delegate {
31 public:
32 virtual void FaviconUpdated() = 0;
34 protected:
35 virtual ~Delegate() {}
38 LauncherFaviconLoader(Delegate* delegate,
39 content::WebContents* web_contents);
40 virtual ~LauncherFaviconLoader();
42 content::WebContents* web_contents() {
43 return web_contents_;
46 // Returns an appropriately sized favicon for the Launcher. If none are
47 // available will return an isNull bitmap.
48 SkBitmap GetFavicon() const;
50 // Returns true if the loader is waiting for downloads to finish.
51 bool HasPendingDownloads() const;
53 private:
54 content::WebContents* web_contents_;
55 scoped_ptr<internal::FaviconBitmapHandler> favicon_handler_;
57 DISALLOW_COPY_AND_ASSIGN(LauncherFaviconLoader);
60 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_FAVICON_LOADER_H_