Do not use virtual function to request shutdown
Would make it easier to port to other platforms.
This commit is contained in:
parent
8ae3d9dd0b
commit
109e2c760f
4 changed files with 36 additions and 13 deletions
|
@ -26,7 +26,7 @@ class PowerObserverLinux : public base::PowerObserver {
|
|||
void BlockShutdown();
|
||||
void UnblockShutdown();
|
||||
|
||||
virtual bool OnShutdown() { return false; }
|
||||
void SetShutdownHandler(base::Callback<bool()> should_shutdown);
|
||||
|
||||
private:
|
||||
void OnLoginServiceAvailable(bool available);
|
||||
|
@ -37,6 +37,8 @@ class PowerObserverLinux : public base::PowerObserver {
|
|||
const std::string& signal,
|
||||
bool success);
|
||||
|
||||
base::Callback<bool()> should_shutdown_;
|
||||
|
||||
scoped_refptr<dbus::Bus> bus_;
|
||||
scoped_refptr<dbus::ObjectProxy> logind_;
|
||||
std::string lock_owner_name_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue