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

Side by Side Diff: chrome/browser/status_icons/desktop_notification_balloon.cc

Issue 768373002: Remove DesktopNotificationService::AddIconNotification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove comment Created 6 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
« no previous file with comments | « chrome/browser/notifications/desktop_notification_service.cc ('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) 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/status_icons/desktop_notification_balloon.h" 5 #include "chrome/browser/status_icons/desktop_notification_balloon.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/threading/thread_restrictions.h" 9 #include "base/threading/thread_restrictions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 const base::string16& title, 72 const base::string16& title,
73 const base::string16& contents) { 73 const base::string16& contents) {
74 // Allowing IO access is required here to cover the corner case where 74 // Allowing IO access is required here to cover the corner case where
75 // there is no last used profile and the default one is loaded. 75 // there is no last used profile and the default one is loaded.
76 // IO access won't be required for normal uses. 76 // IO access won't be required for normal uses.
77 Profile* profile; 77 Profile* profile;
78 { 78 {
79 base::ThreadRestrictions::ScopedAllowIO allow_io; 79 base::ThreadRestrictions::ScopedAllowIO allow_io;
80 profile = ProfileManager::GetLastUsedProfile(); 80 profile = ProfileManager::GetLastUsedProfile();
81 } 81 }
82 notification_id_ = DesktopNotificationService::AddIconNotification( 82
83 GURL(), 83 NotificationDelegate* delegate =
84 title, 84 new DummyNotificationDelegate(base::IntToString(id_count_++), profile_);
85 contents, 85 Notification notification(GURL(), title, contents, gfx::Image(icon),
86 gfx::Image(icon), 86 base::string16(), base::string16(), delegate);
87 base::string16(), 87
88 new DummyNotificationDelegate(base::IntToString(id_count_++), profile_), 88 g_browser_process->notification_ui_manager()->Add(notification, profile);
89 profile); 89
90 notification_id_ = notification.delegate_id();
90 profile_ = profile; 91 profile_ = profile;
91 } 92 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/desktop_notification_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698