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

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

Issue 10828127: Use hi-resolution favicon variants if available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: daringfireball hackfix Created 8 years, 4 months 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 #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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 const std::string& notification_id, 42 const std::string& notification_id,
43 const GURL& icon_url) 43 const GURL& icon_url)
44 : content::WebContentsObserver(web_contents), 44 : content::WebContentsObserver(web_contents),
45 request_id_(0), 45 request_id_(0),
46 notification_id_(notification_id), 46 notification_id_(notification_id),
47 icon_url_(icon_url) { 47 icon_url_(icon_url) {
48 Observe(web_contents); 48 Observe(web_contents);
49 content::RenderViewHost* host = web_contents->GetRenderViewHost(); 49 content::RenderViewHost* host = web_contents->GetRenderViewHost();
50 request_id_ = FaviconUtil::DownloadFavicon(host, 50 request_id_ = FaviconUtil::DownloadFavicon(host,
51 icon_url, 51 icon_url,
52 kNotificationIconImageSize); 52 std::vector<int>(1, kNotification IconImageSize));
53 } 53 }
54 54
55 // content::WebContentsObserver override. 55 // content::WebContentsObserver override.
56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { 56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
57 bool message_handled = false; // Allow other handlers to receive these. 57 bool message_handled = false; // Allow other handlers to receive these.
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;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 ExtensionService* extension_service = 156 ExtensionService* extension_service =
157 balloon_->profile()->GetExtensionService(); 157 balloon_->profile()->GetExtensionService();
158 const GURL& origin = balloon_->notification().origin_url(); 158 const GURL& origin = balloon_->notification().origin_url();
159 const extensions::Extension* extension = 159 const extensions::Extension* extension =
160 extension_service->extensions()->GetExtensionOrAppByURL( 160 extension_service->extensions()->GetExtensionOrAppByURL(
161 ExtensionURLInfo(origin)); 161 ExtensionURLInfo(origin));
162 if (extension) 162 if (extension)
163 return extension->id(); 163 return extension->id();
164 return std::string(); 164 return std::string();
165 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698