Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: chrome/browser/ui/views/ash/balloon_view_ash.h

Issue 11411180: move favicon download code from chrome/ into content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_VIEWS_ASH_BALLOON_VIEW_ASH_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_VIEW_ASH_H_
6 #define CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_VIEW_ASH_H_ 6 #define CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_VIEW_ASH_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "chrome/browser/favicon/favicon_download_helper_delegate.h"
11 #include "chrome/browser/notifications/balloon.h" 10 #include "chrome/browser/notifications/balloon.h"
11 #include "content/public/browser/favicon_download_delegate.h"
12 12
13 class FaviconDownloadHelper;
14 13
15 // On Ash, a "BalloonView" is just a wrapper for ash notification entries. 14 // On Ash, a "BalloonView" is just a wrapper for ash notification entries.
16 class BalloonViewAsh : public BalloonView, 15 class BalloonViewAsh : public BalloonView,
17 public FaviconDownloadHelperDelegate { 16 public content::FaviconDownloadDelegate {
18 public: 17 public:
19 explicit BalloonViewAsh(BalloonCollection* collection); 18 explicit BalloonViewAsh(BalloonCollection* collection);
20 virtual ~BalloonViewAsh(); 19 virtual ~BalloonViewAsh();
21 20
22 // BalloonView interface. 21 // BalloonView interface.
23 virtual void Show(Balloon* balloon) OVERRIDE; 22 virtual void Show(Balloon* balloon) OVERRIDE;
24 virtual void Update() OVERRIDE; 23 virtual void Update() OVERRIDE;
25 virtual void RepositionToBalloon() OVERRIDE; 24 virtual void RepositionToBalloon() OVERRIDE;
26 virtual void Close(bool by_user) OVERRIDE; 25 virtual void Close(bool by_user) OVERRIDE;
27 virtual gfx::Size GetSize() const OVERRIDE; 26 virtual gfx::Size GetSize() const OVERRIDE;
28 virtual BalloonHost* GetHost() const OVERRIDE; 27 virtual BalloonHost* GetHost() const OVERRIDE;
29 28
30 // FaviconDownloadHelperDelegate interface: 29 // Content::FaviconDownloadDelegate interface:
31 virtual void OnDidDownloadFavicon( 30 virtual void DidDownloadFavicon(
32 int id, 31 int id,
33 const GURL& image_url, 32 const GURL& image_url,
34 bool errored, 33 bool errored,
35 int requested_size, 34 int requested_size,
36 const std::vector<SkBitmap>& bitmaps) OVERRIDE; 35 const std::vector<SkBitmap>& bitmaps) OVERRIDE;
37 36
38 private: 37 private:
39 void FetchIcon(const Notification& notification); 38 void FetchIcon(const Notification& notification);
40 std::string GetExtensionId(Balloon* balloon); 39 std::string GetExtensionId(Balloon* balloon);
41 40
42 BalloonCollection* collection_; 41 BalloonCollection* collection_;
43 Balloon* balloon_; 42 Balloon* balloon_;
44 scoped_ptr<FaviconDownloadHelper> icon_fetcher_;
45 43
46 // Track the current notification id and download id so that it can be updated 44 // Track the current notification id and download id so that it can be updated
47 // properly. 45 // properly.
48 int current_download_id_; 46 int current_download_id_;
49 std::string current_notification_id_; 47 std::string current_notification_id_;
50 std::string cached_notification_id_; 48 std::string cached_notification_id_;
51 49
52 DISALLOW_COPY_AND_ASSIGN(BalloonViewAsh); 50 DISALLOW_COPY_AND_ASSIGN(BalloonViewAsh);
53 }; 51 };
54 52
55 #endif // CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_VIEW_ASH_H_ 53 #endif // CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_VIEW_ASH_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698