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

Side by Side Diff: chrome/browser/signin/easy_unlock_service_regular.h

Issue 1022233002: [Smart Lock] Add UMA metrics to measure duration of unlock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hook into the existing PowerMonitor observer Created 5 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_
6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/prefs/pref_change_registrar.h" 13 #include "base/prefs/pref_change_registrar.h"
14 #include "base/time/time.h"
14 #include "chrome/browser/signin/easy_unlock_service.h" 15 #include "chrome/browser/signin/easy_unlock_service.h"
15 #include "chrome/browser/signin/screenlock_bridge.h" 16 #include "chrome/browser/signin/screenlock_bridge.h"
16 17
17 #if defined(OS_CHROMEOS) 18 #if defined(OS_CHROMEOS)
18 #include "chrome/browser/chromeos/login/easy_unlock/short_lived_user_context.h" 19 #include "chrome/browser/chromeos/login/easy_unlock/short_lived_user_context.h"
19 #endif 20 #endif
20 21
21 namespace base { 22 namespace base {
22 class DictionaryValue; 23 class DictionaryValue;
23 class ListValue; 24 class ListValue;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 std::string GetWrappedSecret() const override; 61 std::string GetWrappedSecret() const override;
61 void RecordEasySignInOutcome(const std::string& user_id, 62 void RecordEasySignInOutcome(const std::string& user_id,
62 bool success) const override; 63 bool success) const override;
63 void RecordPasswordLoginEvent(const std::string& user_id) const override; 64 void RecordPasswordLoginEvent(const std::string& user_id) const override;
64 void StartAutoPairing(const AutoPairingResultCallback& callback) override; 65 void StartAutoPairing(const AutoPairingResultCallback& callback) override;
65 void SetAutoPairingResult(bool success, const std::string& error) override; 66 void SetAutoPairingResult(bool success, const std::string& error) override;
66 void InitializeInternal() override; 67 void InitializeInternal() override;
67 void ShutdownInternal() override; 68 void ShutdownInternal() override;
68 bool IsAllowedInternal() const override; 69 bool IsAllowedInternal() const override;
69 void OnWillFinalizeUnlock(bool success) override; 70 void OnWillFinalizeUnlock(bool success) override;
71 void OnSuspendDone() override;
70 72
71 // ScreenlockBridge::Observer implementation: 73 // ScreenlockBridge::Observer implementation:
72 void OnScreenDidLock( 74 void OnScreenDidLock(
73 ScreenlockBridge::LockHandler::ScreenType screen_type) override; 75 ScreenlockBridge::LockHandler::ScreenType screen_type) override;
74 void OnScreenDidUnlock( 76 void OnScreenDidUnlock(
75 ScreenlockBridge::LockHandler::ScreenType screen_type) override; 77 ScreenlockBridge::LockHandler::ScreenType screen_type) override;
76 void OnFocusedUserChanged(const std::string& user_id) override; 78 void OnFocusedUserChanged(const std::string& user_id) override;
77 79
80
78 // Callback when the controlling pref changes. 81 // Callback when the controlling pref changes.
79 void OnPrefsChanged(); 82 void OnPrefsChanged();
80 83
81 // Sets the new turn-off flow status. 84 // Sets the new turn-off flow status.
82 void SetTurnOffFlowStatus(TurnOffFlowStatus status); 85 void SetTurnOffFlowStatus(TurnOffFlowStatus status);
83 86
84 // Callback for ToggleEasyUnlock CryptAuth API. 87 // Callback for ToggleEasyUnlock CryptAuth API.
85 void OnToggleEasyUnlockApiComplete( 88 void OnToggleEasyUnlockApiComplete(
86 const cryptauth::ToggleEasyUnlockResponse& response); 89 const cryptauth::ToggleEasyUnlockResponse& response);
87 void OnToggleEasyUnlockApiFailed(const std::string& error_message); 90 void OnToggleEasyUnlockApiFailed(const std::string& error_message);
(...skipping 21 matching lines...) Expand all
109 TurnOffFlowStatus turn_off_flow_status_; 112 TurnOffFlowStatus turn_off_flow_status_;
110 scoped_ptr<proximity_auth::CryptAuthClient> cryptauth_client_; 113 scoped_ptr<proximity_auth::CryptAuthClient> cryptauth_client_;
111 114
112 AutoPairingResultCallback auto_pairing_callback_; 115 AutoPairingResultCallback auto_pairing_callback_;
113 116
114 // True if the user just unlocked the screen using Easy Unlock. Reset once 117 // True if the user just unlocked the screen using Easy Unlock. Reset once
115 // the screen unlocks. Used to distinguish Easy Unlock-powered unlocks from 118 // the screen unlocks. Used to distinguish Easy Unlock-powered unlocks from
116 // password-based unlocks for metrics. 119 // password-based unlocks for metrics.
117 bool will_unlock_using_easy_unlock_; 120 bool will_unlock_using_easy_unlock_;
118 121
122 // The timestamp for the most recent time when the lock screen was shown. The
123 // lock screen is typically shown when the user awakens her computer from
124 // sleep -- e.g. by opening the lid -- but can also be shown if the screen is
125 // locked but the computer does not go to sleep.
126 base::TimeTicks lock_screen_last_shown_timestamp_;
127
119 base::WeakPtrFactory<EasyUnlockServiceRegular> weak_ptr_factory_; 128 base::WeakPtrFactory<EasyUnlockServiceRegular> weak_ptr_factory_;
120 129
121 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceRegular); 130 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceRegular);
122 }; 131 };
123 132
124 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ 133 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_
OLDNEW
« no previous file with comments | « chrome/browser/signin/easy_unlock_service.cc ('k') | chrome/browser/signin/easy_unlock_service_regular.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698