| OLD | NEW |
| 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_BALLOON_VIEW_WIN_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_VIEW_ASH_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BALLOON_VIEW_WIN_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| 11 #include "chrome/browser/notifications/balloon.h" | 11 #include "chrome/browser/notifications/balloon.h" |
| 12 | 12 |
| 13 class GURL; | 13 class GURL; |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class ImageSkia; | 16 class ImageSkia; |
| 17 } | 17 } |
| 18 | 18 |
| 19 // On Ash, a "BalloonView" is just a wrapper for ash notification entries. | 19 class BalloonViewWin : public BalloonView { |
| 20 class BalloonViewAsh : public BalloonView { | |
| 21 public: | 20 public: |
| 22 explicit BalloonViewAsh(BalloonCollection* collection); | 21 explicit BalloonViewWin(BalloonCollection* collection); |
| 23 virtual ~BalloonViewAsh(); | 22 virtual ~BalloonViewWin(); |
| 24 | 23 |
| 25 // BalloonView interface. | 24 // BalloonView interface. |
| 26 virtual void Show(Balloon* balloon) OVERRIDE; | 25 virtual void Show(Balloon* balloon) OVERRIDE; |
| 27 virtual void Update() OVERRIDE; | 26 virtual void Update() OVERRIDE; |
| 28 virtual void RepositionToBalloon() OVERRIDE; | 27 virtual void RepositionToBalloon() OVERRIDE; |
| 29 virtual void Close(bool by_user) OVERRIDE; | 28 virtual void Close(bool by_user) OVERRIDE; |
| 30 virtual gfx::Size GetSize() const OVERRIDE; | 29 virtual gfx::Size GetSize() const OVERRIDE; |
| 31 virtual BalloonHost* GetHost() const OVERRIDE; | 30 virtual BalloonHost* GetHost() const OVERRIDE; |
| 32 | 31 |
| 33 void SetNotificationIcon(const std::string& id, const gfx::ImageSkia& image); | 32 void SetNotificationIcon(const std::string& id, const gfx::ImageSkia& image); |
| 34 void SetNotificationImage(const std::string& id, const gfx::ImageSkia& image); | 33 void SetNotificationImage(const std::string& id, const gfx::ImageSkia& image); |
| 35 | 34 |
| 36 private: | 35 private: |
| 37 class ImageDownload; | 36 class ImageDownload; |
| 38 | 37 |
| 39 typedef std::vector<linked_ptr<ImageDownload> > ImageDownloads; | 38 typedef std::vector<linked_ptr<ImageDownload> > ImageDownloads; |
| 40 | 39 |
| 41 void DownloadImages(const Notification& notification); | 40 void DownloadImages(const Notification& notification); |
| 42 | 41 |
| 43 BalloonCollection* collection_; | 42 BalloonCollection* collection_; |
| 44 Balloon* balloon_; | 43 Balloon* balloon_; |
| 45 | 44 |
| 46 // Track the current notification id and downloads so the notification can be | 45 // Track the current notification id and downloads so the notification can be |
| 47 // updated properly. | 46 // updated properly. |
| 48 std::string notification_id_; | 47 std::string notification_id_; |
| 49 ImageDownloads downloads_; | 48 ImageDownloads downloads_; |
| 50 | 49 |
| 51 DISALLOW_COPY_AND_ASSIGN(BalloonViewAsh); | 50 DISALLOW_COPY_AND_ASSIGN(BalloonViewWin); |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 #endif // CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_VIEW_ASH_H_ | 53 #endif // CHROME_BROWSER_UI_VIEWS_BALLOON_VIEW_WIN_H_ |
| OLD | NEW |