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

Unified Diff: chrome/browser/profile.cc

Issue 194108: adds DesktopNotificationService to Profile (Closed)
Patch Set: more feedback Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profile.cc
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 450864417704803142d869046a0e70fc63d8bf53..87c9713f25c2d438778b2b72866647ffa33d9397 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -27,6 +27,7 @@
#include "chrome/browser/in_process_webkit/webkit_context.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/net/ssl_config_service_manager.h"
+#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/password_manager/password_store_default.h"
#include "chrome/browser/privacy_blacklist/blacklist.h"
#include "chrome/browser/profile_manager.h"
@@ -459,6 +460,10 @@ class OffTheRecordProfileImpl : public Profile,
return profile_->GetBookmarkModel();
}
+ virtual DesktopNotificationService* GetDesktopNotificationService() {
+ return profile_->GetDesktopNotificationService();
+ }
+
virtual ProfileSyncService* GetProfileSyncService() {
return NULL;
}
@@ -1344,6 +1349,17 @@ WebKitContext* ProfileImpl::GetWebKitContext() {
return webkit_context_.get();
}
+DesktopNotificationService* ProfileImpl::GetDesktopNotificationService() {
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ if (!desktop_notification_service_.get()) {
+ // TODO(johnnyg): hook this up with notification UI manager.
+ desktop_notification_service_.reset(new DesktopNotificationService(
+ this, NULL));
+ }
+
+ return desktop_notification_service_.get();
+}
+
void ProfileImpl::MarkAsCleanShutdown() {
if (prefs_.get()) {
// The session cleanly exited, set kSessionExitedCleanly appropriately.

Powered by Google App Engine
This is Rietveld 408576698