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

Unified Diff: chrome/browser/local_discovery/privet_notifications.cc

Issue 186983003: [Privet] Do not show notifications from guest and default profiles in ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/local_discovery/privet_notifications.cc
diff --git a/chrome/browser/local_discovery/privet_notifications.cc b/chrome/browser/local_discovery/privet_notifications.cc
index 5d7ed0aa7de72d3928362c6f72d7d1dfbfc5b815..cf3b5ec11e695efcfad1d4bcebf69efb2efe695c 100644
--- a/chrome/browser/local_discovery/privet_notifications.cc
+++ b/chrome/browser/local_discovery/privet_notifications.cc
@@ -19,6 +19,8 @@
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/signin_manager_base.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
@@ -284,6 +286,15 @@ void PrivetNotificationService::PrivetRemoveNotification() {
}
void PrivetNotificationService::Start() {
+#if defined(CHROMEOS)
+ SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfileIfExists(
+ Profile::FromBrowserContext(profile_));
+
+ if (!signin_manager || signin_manager->GetAuthenticatedUsername().empty())
Vitaly Buka (NO REVIEWS) 2014/03/04 22:47:33 I guess that's not enough. service keeps running a
Noam Samuel 2014/03/04 22:58:49 Have we seen this behavior? I'd suspect notificati
+ return;
+#endif
+
enable_privet_notification_member_.Init(
prefs::kLocalDiscoveryNotificationsEnabled,
Profile::FromBrowserContext(profile_)->GetPrefs(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698