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

Side by Side Diff: chrome/browser/chromeos/login/quick_unlock/quick_unlock_notification_controller.cc

Issue 2715823004: Add FingerprintUnlock KeyedService for each profile (Closed)
Patch Set: rebase Created 3 years, 9 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
OLDNEW
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/common/strings/grit/ash_strings.h" 7 #include "ash/common/strings/grit/ash_strings.h"
8 #include "ash/common/system/system_notifier.h" 8 #include "ash/common/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"
11 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h" 11 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h"
12 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h" 12 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h"
13 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" 13 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
14 #include "chrome/browser/notifications/notification.h" 14 #include "chrome/browser/notifications/notification.h"
15 #include "chrome/browser/notifications/notification_ui_manager.h" 15 #include "chrome/browser/notifications/notification_ui_manager.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser_navigator.h" 17 #include "chrome/browser/ui/browser_navigator.h"
18 #include "chrome/browser/ui/browser_navigator_params.h" 18 #include "chrome/browser/ui/browser_navigator_params.h"
19 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
20 #include "chrome/common/url_constants.h" 20 #include "chrome/common/url_constants.h"
21 #include "chrome/grit/theme_resources.h" 21 #include "chrome/grit/theme_resources.h"
22 #include "components/prefs/pref_service.h" 22 #include "components/prefs/pref_service.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 prefs::kQuickUnlockFeatureNotificationShown)) { 84 prefs::kQuickUnlockFeatureNotificationShown)) {
85 return false; 85 return false;
86 } 86 }
87 87
88 // Do not show notification if policy does not allow PIN, or if user is 88 // Do not show notification if policy does not allow PIN, or if user is
89 // supervised. 89 // supervised.
90 if (!IsPinEnabled(profile->GetPrefs())) 90 if (!IsPinEnabled(profile->GetPrefs()))
91 return false; 91 return false;
92 92
93 // Do not show the notification if the pin is already set. 93 // Do not show the notification if the pin is already set.
94 PinStorage* pin_storage = PinStorageFactory::GetForProfile(profile); 94 PinStorage* pin_storage =
95 QuickUnlockFactory::GetForProfile(profile)->pin_storage();
95 if (pin_storage->IsPinSet()) 96 if (pin_storage->IsPinSet())
96 return false; 97 return false;
97 98
98 // TODO(jdufault): Enable once quick unlock settings land(crbug.com/291747). 99 // TODO(jdufault): Enable once quick unlock settings land(crbug.com/291747).
99 return false; 100 return false;
100 } 101 }
101 102
102 // NotificationDelegate override: 103 // NotificationDelegate override:
103 std::string QuickUnlockNotificationController::id() const { 104 std::string QuickUnlockNotificationController::id() const {
104 return params_.delegate_id; 105 return params_.delegate_id;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, 180 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
180 params_.notifier), 181 params_.notifier),
181 l10n_util::GetStringUTF16(params_.feature_name_id), GURL(), 182 l10n_util::GetStringUTF16(params_.feature_name_id), GURL(),
182 params_.notification_id, message_center::RichNotificationData(), this); 183 params_.notification_id, message_center::RichNotificationData(), this);
183 } 184 }
184 185
185 QuickUnlockNotificationController::NotificationParams::NotificationParams() {} 186 QuickUnlockNotificationController::NotificationParams::NotificationParams() {}
186 187
187 QuickUnlockNotificationController::NotificationParams::~NotificationParams() {} 188 QuickUnlockNotificationController::NotificationParams::~NotificationParams() {}
188 189
189 } // quick_unlock 190 } // namespace quick_unlock
190 } // namespace chromeos 191 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698