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

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

Issue 445353004: GetProfileByUser deprecated and renamed to GetProfileByUserUnsafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. Created 6 years, 4 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/notifications/message_center_settings_controller.h" 5 #include "chrome/browser/notifications/message_center_settings_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/string_compare.h" 10 #include "base/i18n/string_compare.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 // Already created. 445 // Already created.
446 if (!notifier_groups_.empty()) 446 if (!notifier_groups_.empty())
447 return; 447 return;
448 448
449 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); 449 chromeos::UserManager* user_manager = chromeos::UserManager::Get();
450 // |notifier_groups_| can be empty in login screen too. 450 // |notifier_groups_| can be empty in login screen too.
451 if (!user_manager->IsLoggedInAsGuest()) 451 if (!user_manager->IsLoggedInAsGuest())
452 return; 452 return;
453 453
454 user_manager::User* user = user_manager->GetActiveUser(); 454 user_manager::User* user = user_manager->GetActiveUser();
455 Profile* profile = chromeos::ProfileHelper::Get()->GetProfileByUser(user); 455 Profile* profile =
456 chromeos::ProfileHelper::Get()->GetProfileByUserUnsafe(user);
456 DCHECK(profile); 457 DCHECK(profile);
457 notifier_groups_.push_back( 458 notifier_groups_.push_back(
458 new message_center::ProfileNotifierGroup(gfx::Image(user->GetImage()), 459 new message_center::ProfileNotifierGroup(gfx::Image(user->GetImage()),
459 user->GetDisplayName(), 460 user->GetDisplayName(),
460 user->GetDisplayName(), 461 user->GetDisplayName(),
461 0, 462 0,
462 profile)); 463 profile));
463 464
464 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, 465 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver,
465 observers_, 466 observers_,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 // another creating a primary profile, and causes an infinite loop. 518 // another creating a primary profile, and causes an infinite loop.
518 // Thus, it would be better to delay creating group for guest login. 519 // Thus, it would be better to delay creating group for guest login.
519 base::MessageLoopProxy::current()->PostTask( 520 base::MessageLoopProxy::current()->PostTask(
520 FROM_HERE, 521 FROM_HERE,
521 base::Bind( 522 base::Bind(
522 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, 523 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin,
523 weak_factory_.GetWeakPtr())); 524 weak_factory_.GetWeakPtr()));
524 } 525 }
525 #endif 526 #endif
526 } 527 }
OLDNEW
« no previous file with comments | « chrome/browser/net/nss_context_chromeos_browsertest.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698