| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/quick_unlock/quick_unlock_notification_c
ontroller.h" | 5 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_notification_c
ontroller.h" |
| 6 | 6 |
| 7 #include "ash/strings/grit/ash_strings.h" | 7 #include "ash/strings/grit/ash_strings.h" |
| 8 #include "ash/system/system_notifier.h" | 8 #include "ash/system/system_notifier.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 if (profile->GetPrefs()->GetBoolean( | 87 if (profile->GetPrefs()->GetBoolean( |
| 88 prefs::kPinUnlockFeatureNotificationShown)) { | 88 prefs::kPinUnlockFeatureNotificationShown)) { |
| 89 return false; | 89 return false; |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Do not show notification if policy does not allow PIN, or if user is | 92 // Do not show notification if policy does not allow PIN, or if user is |
| 93 // supervised. | 93 // supervised. |
| 94 if (!IsPinEnabled(profile->GetPrefs())) | 94 if (!IsPinEnabled(profile->GetPrefs())) |
| 95 return false; | 95 return false; |
| 96 | 96 |
| 97 // Do not show the notification if the pin is already set. | 97 // TODO(jdufault): Do not show the notification if the pin is already set. |
| 98 PinStorage* pin_storage = | |
| 99 QuickUnlockFactory::GetForProfile(profile)->pin_storage(); | |
| 100 if (pin_storage->IsPinSet()) | |
| 101 return false; | |
| 102 | |
| 103 // TODO(jdufault): Enable once quick unlock settings land(crbug.com/291747). | |
| 104 return false; | 98 return false; |
| 105 } | 99 } |
| 106 | 100 |
| 107 // static | 101 // static |
| 108 QuickUnlockNotificationController* | 102 QuickUnlockNotificationController* |
| 109 QuickUnlockNotificationController::CreateForFingerprint(Profile* profile) { | 103 QuickUnlockNotificationController::CreateForFingerprint(Profile* profile) { |
| 110 QuickUnlockNotificationController* controller = | 104 QuickUnlockNotificationController* controller = |
| 111 new QuickUnlockNotificationController(profile); | 105 new QuickUnlockNotificationController(profile); |
| 112 | 106 |
| 113 // Set the fingerprint notification parameters. | 107 // Set the fingerprint notification parameters. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 l10n_util::GetStringUTF16(params_.feature_name_id), GURL(), | 227 l10n_util::GetStringUTF16(params_.feature_name_id), GURL(), |
| 234 params_.notification_id, message_center::RichNotificationData(), this); | 228 params_.notification_id, message_center::RichNotificationData(), this); |
| 235 } | 229 } |
| 236 | 230 |
| 237 QuickUnlockNotificationController::NotificationParams::NotificationParams() {} | 231 QuickUnlockNotificationController::NotificationParams::NotificationParams() {} |
| 238 | 232 |
| 239 QuickUnlockNotificationController::NotificationParams::~NotificationParams() {} | 233 QuickUnlockNotificationController::NotificationParams::~NotificationParams() {} |
| 240 | 234 |
| 241 } // namespace quick_unlock | 235 } // namespace quick_unlock |
| 242 } // namespace chromeos | 236 } // namespace chromeos |
| OLD | NEW |