| 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 #include "chrome/browser/ui/views/ash/balloon_view_ash.h" | 5 #include "chrome/browser/ui/views/ash/balloon_view_ash.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/status_area_widget.h" | 8 #include "ash/system/status_area_widget.h" |
| 9 #include "ash/system/web_notification/web_notification_tray.h" | 9 #include "ash/system/web_notification/web_notification_tray.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 IPC_BEGIN_MESSAGE_MAP(IconFetcher, message) | 58 IPC_BEGIN_MESSAGE_MAP(IconFetcher, message) |
| 59 IPC_MESSAGE_HANDLER(IconHostMsg_DidDownloadFavicon, OnDidDownloadFavicon) | 59 IPC_MESSAGE_HANDLER(IconHostMsg_DidDownloadFavicon, OnDidDownloadFavicon) |
| 60 IPC_MESSAGE_UNHANDLED(message_handled = false) | 60 IPC_MESSAGE_UNHANDLED(message_handled = false) |
| 61 IPC_END_MESSAGE_MAP() | 61 IPC_END_MESSAGE_MAP() |
| 62 return message_handled; | 62 return message_handled; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void OnDidDownloadFavicon(int id, | 65 void OnDidDownloadFavicon(int id, |
| 66 const GURL& image_url, | 66 const GURL& image_url, |
| 67 bool errored, | 67 bool errored, |
| 68 const SkBitmap& bitmap) { | 68 int requested_size, |
| 69 if (image_url != icon_url_ || id != request_id_) | 69 const std::vector<SkBitmap>& bitmaps) { |
| 70 if (image_url != icon_url_ || id != request_id_ || bitmaps.empty()) |
| 70 return; | 71 return; |
| 71 GetWebNotificationTray()->SetNotificationImage( | 72 GetWebNotificationTray()->SetNotificationImage( |
| 72 notification_id_, gfx::ImageSkia(bitmap)); | 73 notification_id_, gfx::ImageSkia(bitmaps[0])); |
| 73 } | 74 } |
| 74 | 75 |
| 75 private: | 76 private: |
| 76 int request_id_; | 77 int request_id_; |
| 77 std::string notification_id_; | 78 std::string notification_id_; |
| 78 GURL icon_url_; | 79 GURL icon_url_; |
| 79 | 80 |
| 80 DISALLOW_COPY_AND_ASSIGN(IconFetcher); | 81 DISALLOW_COPY_AND_ASSIGN(IconFetcher); |
| 81 }; | 82 }; |
| 82 | 83 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 ExtensionService* extension_service = | 157 ExtensionService* extension_service = |
| 157 balloon_->profile()->GetExtensionService(); | 158 balloon_->profile()->GetExtensionService(); |
| 158 const GURL& origin = balloon_->notification().origin_url(); | 159 const GURL& origin = balloon_->notification().origin_url(); |
| 159 const extensions::Extension* extension = | 160 const extensions::Extension* extension = |
| 160 extension_service->extensions()->GetExtensionOrAppByURL( | 161 extension_service->extensions()->GetExtensionOrAppByURL( |
| 161 ExtensionURLInfo(origin)); | 162 ExtensionURLInfo(origin)); |
| 162 if (extension) | 163 if (extension) |
| 163 return extension->id(); | 164 return extension->id(); |
| 164 return std::string(); | 165 return std::string(); |
| 165 } | 166 } |
| OLD | NEW |