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

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

Issue 528423002: Unload Easy Unlock app when ChromeOS suspends and reload on wake up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unload instead of uninstalling app Created 6 years, 3 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_H_ 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_
6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return turn_off_flow_status_; 77 return turn_off_flow_status_;
78 } 78 }
79 79
80 private: 80 private:
81 // A class to detect whether a bluetooth adapter is present. 81 // A class to detect whether a bluetooth adapter is present.
82 class BluetoothDetector; 82 class BluetoothDetector;
83 83
84 // Initializes the service after ExtensionService is ready. 84 // Initializes the service after ExtensionService is ready.
85 void Initialize(); 85 void Initialize();
86 86
87 // Loads the Easy unlock component app. 87 // Installs the Easy unlock component app if it isn't installed or enables
88 // the app if it is installed but disabled.
88 void LoadApp(); 89 void LoadApp();
89 90
90 // Unloads the Easy unlock component app. 91 // Disables the Easy unlock component app.
91 void UnloadApp(); 92 void DisableApp();
92 93
93 // Checks whether Easy unlock should be running and updates app state. 94 // Checks whether Easy unlock should be running and updates app state.
94 void UpdateAppState(); 95 void UpdateAppState();
95 96
96 // Callback when the controlling pref changes. 97 // Callback when the controlling pref changes.
97 void OnPrefsChanged(); 98 void OnPrefsChanged();
98 99
99 // Callback when Bluetooth adapter present state changes. 100 // Callback when Bluetooth adapter present state changes.
100 void OnBluetoothAdapterPresentChanged(); 101 void OnBluetoothAdapterPresentChanged();
101 102
102 // Sets the new turn-off flow status. 103 // Sets the new turn-off flow status.
103 void SetTurnOffFlowStatus(TurnOffFlowStatus status); 104 void SetTurnOffFlowStatus(TurnOffFlowStatus status);
104 105
105 // Callback invoked when turn off flow has finished. 106 // Callback invoked when turn off flow has finished.
106 void OnTurnOffFlowFinished(bool success); 107 void OnTurnOffFlowFinished(bool success);
107 108
108 Profile* profile_; 109 Profile* profile_;
109 PrefChangeRegistrar registrar_; 110 PrefChangeRegistrar registrar_;
110 scoped_ptr<BluetoothDetector> bluetooth_detector_; 111 scoped_ptr<BluetoothDetector> bluetooth_detector_;
111 // Created lazily in |GetScreenlockStateHandler|. 112 // Created lazily in |GetScreenlockStateHandler|.
112 scoped_ptr<EasyUnlockScreenlockStateHandler> screenlock_state_handler_; 113 scoped_ptr<EasyUnlockScreenlockStateHandler> screenlock_state_handler_;
113 114
114 TurnOffFlowStatus turn_off_flow_status_; 115 TurnOffFlowStatus turn_off_flow_status_;
115 scoped_ptr<EasyUnlockToggleFlow> turn_off_flow_; 116 scoped_ptr<EasyUnlockToggleFlow> turn_off_flow_;
116 ObserverList<EasyUnlockServiceObserver> observers_; 117 ObserverList<EasyUnlockServiceObserver> observers_;
117 118
119 #if defined(OS_CHROMEOS)
120 // Monitors suspend and wake state of ChromeOS.
121 class PowerMonitor;
122 scoped_ptr<PowerMonitor> power_monitor_;
123 #endif
124
118 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; 125 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_;
119 126
120 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); 127 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService);
121 }; 128 };
122 129
123 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ 130 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/signin/easy_unlock_service.cc » ('j') | chrome/browser/signin/easy_unlock_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698