| OLD | NEW |
| 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/chromeos/login/multi_profile_first_run_notification.h" | 5 #include "chrome/browser/chromeos/login/multi_profile_first_run_notification.h" |
| 6 | 6 |
| 7 #include "ash/system/system_notifier.h" | 7 #include "ash/system/system_notifier.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "chrome/browser/chromeos/login/user_manager.h" | 10 #include "chrome/browser/chromeos/login/user_manager.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 MultiProfileFirstRunNotification::~MultiProfileFirstRunNotification() {} | 60 MultiProfileFirstRunNotification::~MultiProfileFirstRunNotification() {} |
| 61 | 61 |
| 62 // static | 62 // static |
| 63 void MultiProfileFirstRunNotification::RegisterProfilePrefs( | 63 void MultiProfileFirstRunNotification::RegisterProfilePrefs( |
| 64 user_prefs::PrefRegistrySyncable* registry) { | 64 user_prefs::PrefRegistrySyncable* registry) { |
| 65 registry->RegisterBooleanPref( | 65 registry->RegisterBooleanPref( |
| 66 prefs::kMultiProfileNotificationDismissed, | 66 prefs::kMultiProfileNotificationDismissed, |
| 67 false, | 67 false, |
| 68 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 68 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 69 registry->RegisterBooleanPref( |
| 70 prefs::kMultiProfileNeverShowIntro, |
| 71 false, |
| 72 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 69 } | 73 } |
| 70 | 74 |
| 71 void MultiProfileFirstRunNotification::UserProfilePrepared( | 75 void MultiProfileFirstRunNotification::UserProfilePrepared( |
| 72 Profile* user_profile) { | 76 Profile* user_profile) { |
| 73 if (!UserManager::IsMultipleProfilesAllowed() || | 77 if (!UserManager::IsMultipleProfilesAllowed() || |
| 74 UserManager::Get()->GetLoggedInUsers().size() > 1 || | 78 UserManager::Get()->GetLoggedInUsers().size() > 1 || |
| 75 user_profile->GetPrefs()->GetBoolean( | 79 user_profile->GetPrefs()->GetBoolean( |
| 76 prefs::kMultiProfileNotificationDismissed)) { | 80 prefs::kMultiProfileNotificationDismissed)) { |
| 77 return; | 81 return; |
| 78 } | 82 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 98 notification->SetSystemPriority(); | 102 notification->SetSystemPriority(); |
| 99 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 103 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); |
| 100 } | 104 } |
| 101 | 105 |
| 102 void MultiProfileFirstRunNotification::OnDismissed(Profile* user_profile) { | 106 void MultiProfileFirstRunNotification::OnDismissed(Profile* user_profile) { |
| 103 user_profile->GetPrefs()->SetBoolean( | 107 user_profile->GetPrefs()->SetBoolean( |
| 104 prefs::kMultiProfileNotificationDismissed, true); | 108 prefs::kMultiProfileNotificationDismissed, true); |
| 105 } | 109 } |
| 106 | 110 |
| 107 } // namespace chromeos | 111 } // namespace chromeos |
| OLD | NEW |