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

Side by Side Diff: chrome/browser/local_discovery/privet_notifications.cc

Issue 479353003: Add IsAuthenticated() method to SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/local_discovery/privet_notifications.h" 5 #include "chrome/browser/local_discovery/privet_notifications.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 g_browser_process->notification_ui_manager()->CancelById( 290 g_browser_process->notification_ui_manager()->CancelById(
291 kPrivetNotificationID); 291 kPrivetNotificationID);
292 } 292 }
293 293
294 void PrivetNotificationService::Start() { 294 void PrivetNotificationService::Start() {
295 #if defined(CHROMEOS) 295 #if defined(CHROMEOS)
296 SigninManagerBase* signin_manager = 296 SigninManagerBase* signin_manager =
297 SigninManagerFactory::GetForProfileIfExists( 297 SigninManagerFactory::GetForProfileIfExists(
298 Profile::FromBrowserContext(profile_)); 298 Profile::FromBrowserContext(profile_));
299 299
300 if (!signin_manager || signin_manager->GetAuthenticatedUsername().empty()) 300 if (!signin_manager || !signin_manager->IsAuthenticated())
301 return; 301 return;
302 #endif 302 #endif
303 303
304 enable_privet_notification_member_.Init( 304 enable_privet_notification_member_.Init(
305 prefs::kLocalDiscoveryNotificationsEnabled, 305 prefs::kLocalDiscoveryNotificationsEnabled,
306 Profile::FromBrowserContext(profile_)->GetPrefs(), 306 Profile::FromBrowserContext(profile_)->GetPrefs(),
307 base::Bind(&PrivetNotificationService::OnNotificationsEnabledChanged, 307 base::Bind(&PrivetNotificationService::OnNotificationsEnabledChanged,
308 base::Unretained(this))); 308 base::Unretained(this)));
309 OnNotificationsEnabledChanged(); 309 OnNotificationsEnabledChanged();
310 } 310 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 407
408 void PrivetNotificationDelegate::DisableNotifications() { 408 void PrivetNotificationDelegate::DisableNotifications() {
409 Profile* profile_obj = Profile::FromBrowserContext(profile_); 409 Profile* profile_obj = Profile::FromBrowserContext(profile_);
410 410
411 profile_obj->GetPrefs()->SetBoolean( 411 profile_obj->GetPrefs()->SetBoolean(
412 prefs::kLocalDiscoveryNotificationsEnabled, 412 prefs::kLocalDiscoveryNotificationsEnabled,
413 false); 413 false);
414 } 414 }
415 415
416 } // namespace local_discovery 416 } // namespace local_discovery
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_component_loader.cc ('k') | chrome/browser/metrics/signin_status_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698