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

Side by Side Diff: chrome/browser/notifications/desktop_notification_service.cc

Issue 7742002: Change the icon on the desktop notifications infobar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing since I last tried to submit awhile ago. Created 9 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
« no previous file with comments | « chrome/app/theme/theme_resources_standard.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/notifications/desktop_notification_service.h" 5 #include "chrome/browser/notifications/desktop_notification_service.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/threading/thread.h" 8 #include "base/threading/thread.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 20 matching lines...) Expand all
31 #include "content/browser/browser_child_process_host.h" 31 #include "content/browser/browser_child_process_host.h"
32 #include "content/browser/renderer_host/render_view_host.h" 32 #include "content/browser/renderer_host/render_view_host.h"
33 #include "content/browser/site_instance.h" 33 #include "content/browser/site_instance.h"
34 #include "content/browser/worker_host/worker_process_host.h" 34 #include "content/browser/worker_host/worker_process_host.h"
35 #include "content/public/browser/browser_thread.h" 35 #include "content/public/browser/browser_thread.h"
36 #include "content/public/browser/notification_service.h" 36 #include "content/public/browser/notification_service.h"
37 #include "content/public/common/show_desktop_notification_params.h" 37 #include "content/public/common/show_desktop_notification_params.h"
38 #include "grit/browser_resources.h" 38 #include "grit/browser_resources.h"
39 #include "grit/chromium_strings.h" 39 #include "grit/chromium_strings.h"
40 #include "grit/generated_resources.h" 40 #include "grit/generated_resources.h"
41 #include "grit/theme_resources.h" 41 #include "grit/theme_resources_standard.h"
42 #include "net/base/escape.h" 42 #include "net/base/escape.h"
43 #include "ui/base/l10n/l10n_util.h" 43 #include "ui/base/l10n/l10n_util.h"
44 #include "ui/base/resource/resource_bundle.h" 44 #include "ui/base/resource/resource_bundle.h"
45 45
46 using content::BrowserThread; 46 using content::BrowserThread;
47 using WebKit::WebNotificationPresenter; 47 using WebKit::WebNotificationPresenter;
48 using WebKit::WebTextDirection; 48 using WebKit::WebTextDirection;
49 49
50 const ContentSetting kDefaultSetting = CONTENT_SETTING_ASK; 50 const ContentSetting kDefaultSetting = CONTENT_SETTING_ASK;
51 51
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (!action_taken_) 120 if (!action_taken_)
121 UMA_HISTOGRAM_COUNTS("NotificationPermissionRequest.Ignored", 1); 121 UMA_HISTOGRAM_COUNTS("NotificationPermissionRequest.Ignored", 1);
122 122
123 RenderViewHost* host = RenderViewHost::FromID(process_id_, route_id_); 123 RenderViewHost* host = RenderViewHost::FromID(process_id_, route_id_);
124 if (host) 124 if (host)
125 host->DesktopNotificationPermissionRequestDone(callback_context_); 125 host->DesktopNotificationPermissionRequestDone(callback_context_);
126 } 126 }
127 127
128 gfx::Image* NotificationPermissionInfoBarDelegate::GetIcon() const { 128 gfx::Image* NotificationPermissionInfoBarDelegate::GetIcon() const {
129 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 129 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
130 IDR_PRODUCT_LOGO_32); 130 IDR_INFOBAR_DESKTOP_NOTIFICATIONS);
131 } 131 }
132 132
133 InfoBarDelegate::Type 133 InfoBarDelegate::Type
134 NotificationPermissionInfoBarDelegate::GetInfoBarType() const { 134 NotificationPermissionInfoBarDelegate::GetInfoBarType() const {
135 return PAGE_ACTION_TYPE; 135 return PAGE_ACTION_TYPE;
136 } 136 }
137 137
138 string16 NotificationPermissionInfoBarDelegate::GetMessageText() const { 138 string16 NotificationPermissionInfoBarDelegate::GetMessageText() const {
139 return l10n_util::GetStringFUTF16(IDS_NOTIFICATION_PERMISSIONS, 139 return l10n_util::GetStringFUTF16(IDS_NOTIFICATION_PERMISSIONS,
140 display_name_); 140 display_name_);
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 444
445 if (setting == CONTENT_SETTING_ALLOW) 445 if (setting == CONTENT_SETTING_ALLOW)
446 return WebKit::WebNotificationPresenter::PermissionAllowed; 446 return WebKit::WebNotificationPresenter::PermissionAllowed;
447 if (setting == CONTENT_SETTING_BLOCK) 447 if (setting == CONTENT_SETTING_BLOCK)
448 return WebKit::WebNotificationPresenter::PermissionDenied; 448 return WebKit::WebNotificationPresenter::PermissionDenied;
449 if (setting == CONTENT_SETTING_ASK) 449 if (setting == CONTENT_SETTING_ASK)
450 return WebKit::WebNotificationPresenter::PermissionNotAllowed; 450 return WebKit::WebNotificationPresenter::PermissionNotAllowed;
451 NOTREACHED() << "Invalid notifications settings value: " << setting; 451 NOTREACHED() << "Invalid notifications settings value: " << setting;
452 return WebKit::WebNotificationPresenter::PermissionNotAllowed; 452 return WebKit::WebNotificationPresenter::PermissionNotAllowed;
453 } 453 }
OLDNEW
« no previous file with comments | « chrome/app/theme/theme_resources_standard.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698