forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert 194589 "Revert 194578 "Add ash SessionStateDelegate""
The CL turned out to be innocent, the bots turned green without the revert. > Revert 194578 "Add ash SessionStateDelegate" > > > Add ash SessionStateDelegate > > > > This CL refactors the ShellDelegate by adding a SessionStateDelegate to > > which methods dealing with the session state can be moved. This cleans up > > the huge ShellDelegate interface and paves the way for further Chrome OS > > multiprofile work which will need to add several new methods related to > > the session state. > > > > This CL is only the first step. Several other methods should also move to > > SessionStateDelegate but I do not want to overburden a single CL. > > > > BUG=None > > TEST=Manual and browser/unit tests > > > > TBR=sky (for c/b/idle_chromeos.cc and c/chrome_browser_ui.gypi) > > > > Review URL: https://codereview.chromium.org/14295008 > > TBR=bartfab@google.com > > Review URL: https://codereview.chromium.org/14200034 TBR=gavinp@chromium.org Review URL: https://codereview.chromium.org/14200038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194602 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
bartfab@google.com
committed
Apr 17, 2013
1 parent
6f9c92a
commit fcb123d
Showing
50 changed files
with
553 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ASH_SESSION_STATE_DELEGATE_H_ | ||
#define ASH_SESSION_STATE_DELEGATE_H_ | ||
|
||
#include "ash/ash_export.h" | ||
|
||
namespace ash { | ||
|
||
// Delegate for checking and modifying the session state. | ||
class ASH_EXPORT SessionStateDelegate { | ||
public: | ||
virtual ~SessionStateDelegate() {}; | ||
|
||
// Returns |true| if a session is in progress and there is an active user. | ||
virtual bool HasActiveUser() const = 0; | ||
|
||
// Returns |true| if the session has been fully started for the active user. | ||
// When a user becomes active, the profile and browser UI are not immediately | ||
// available. Only once this method starts returning |true| is the browser | ||
// startup complete and both profile and UI are fully available. | ||
virtual bool IsActiveUserSessionStarted() const = 0; | ||
|
||
// Returns true if the screen can be locked. | ||
virtual bool CanLockScreen() const = 0; | ||
|
||
// Returns true if the screen is currently locked. | ||
virtual bool IsScreenLocked() const = 0; | ||
|
||
// Locks the screen. The locking happens asynchronously. | ||
virtual void LockScreen() = 0; | ||
|
||
// Unlocks the screen. | ||
virtual void UnlockScreen() = 0; | ||
}; | ||
|
||
} // namespace ash | ||
|
||
#endif // ASH_SESSION_STATE_DELEGATE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ash/session_state_delegate_stub.h" | ||
|
||
#include "ash/shell.h" | ||
#include "ash/shell/example_factory.h" | ||
|
||
namespace ash { | ||
|
||
SessionStateDelegateStub::SessionStateDelegateStub() : screen_locked_(false) { | ||
} | ||
|
||
SessionStateDelegateStub::~SessionStateDelegateStub() { | ||
} | ||
|
||
bool SessionStateDelegateStub::HasActiveUser() const { | ||
return true; | ||
} | ||
|
||
bool SessionStateDelegateStub::IsActiveUserSessionStarted() const { | ||
return true; | ||
} | ||
|
||
bool SessionStateDelegateStub::CanLockScreen() const { | ||
return true; | ||
} | ||
|
||
bool SessionStateDelegateStub::IsScreenLocked() const { | ||
return screen_locked_; | ||
} | ||
|
||
void SessionStateDelegateStub::LockScreen() { | ||
shell::CreateLockScreen(); | ||
screen_locked_ = true; | ||
Shell::GetInstance()->UpdateShelfVisibility(); | ||
} | ||
|
||
void SessionStateDelegateStub::UnlockScreen() { | ||
screen_locked_ = false; | ||
Shell::GetInstance()->UpdateShelfVisibility(); | ||
} | ||
|
||
} // namespace ash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ASH_SESSION_STATE_DELEGATE_STUB_H_ | ||
#define ASH_SESSION_STATE_DELEGATE_STUB_H_ | ||
|
||
#include "ash/session_state_delegate.h" | ||
#include "base/basictypes.h" | ||
#include "base/compiler_specific.h" | ||
|
||
namespace ash { | ||
|
||
// Stub implementation of SessionStateDelegate for testing. | ||
class SessionStateDelegateStub : public SessionStateDelegate { | ||
public: | ||
SessionStateDelegateStub(); | ||
virtual ~SessionStateDelegateStub(); | ||
|
||
// SessionStateDelegate: | ||
virtual bool HasActiveUser() const OVERRIDE; | ||
virtual bool IsActiveUserSessionStarted() const OVERRIDE; | ||
virtual bool CanLockScreen() const OVERRIDE; | ||
virtual bool IsScreenLocked() const OVERRIDE; | ||
virtual void LockScreen() OVERRIDE; | ||
virtual void UnlockScreen() OVERRIDE; | ||
|
||
private: | ||
bool screen_locked_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub); | ||
}; | ||
|
||
} // namespace ash | ||
|
||
#endif // ASH_SESSION_STATE_DELEGATE_STUB_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.