diff options
author | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-17 14:47:48 +0000 |
---|---|---|
committer | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-17 14:47:48 +0000 |
commit | f2192efaf719d6e54459fde8ef38093e08e194e0 (patch) | |
tree | 26b06fa106a8ab701dcda5e4c00f959d9d82a700 /ash/accelerators | |
parent | b0b94f5c503e44cc2190a9c7c4d20425f77e6a42 (diff) | |
download | chromium_src-f2192efaf719d6e54459fde8ef38093e08e194e0.zip chromium_src-f2192efaf719d6e54459fde8ef38093e08e194e0.tar.gz chromium_src-f2192efaf719d6e54459fde8ef38093e08e194e0.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194589 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/accelerators')
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 11 | ||||
-rw-r--r-- | ash/accelerators/nested_dispatcher_controller_unittest.cc | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index a98c4b36..9face4f 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -26,7 +26,6 @@ #include "ash/root_window_controller.h" #include "ash/rotator/screen_rotation.h" #include "ash/screenshot_delegate.h" -#include "ash/session_state_delegate.h" #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/shell_delegate.h" @@ -102,7 +101,7 @@ void HandleCycleWindowLinear(CycleDirection direction) { #if defined(OS_CHROMEOS) bool HandleLock() { - Shell::GetInstance()->session_state_delegate()->LockScreen(); + Shell::GetInstance()->delegate()->LockScreen(); return true; } @@ -428,12 +427,16 @@ bool AcceleratorController::IsReservedAccelerator( bool AcceleratorController::PerformAction(int action, const ui::Accelerator& accelerator) { ash::Shell* shell = ash::Shell::GetInstance(); - if (!shell->session_state_delegate()->IsActiveUserSessionStarted() && + bool at_login_screen = false; +#if defined(OS_CHROMEOS) + at_login_screen = !shell->delegate()->IsSessionStarted(); +#endif + if (at_login_screen && actions_allowed_at_login_screen_.find(action) == actions_allowed_at_login_screen_.end()) { return false; } - if (shell->session_state_delegate()->IsScreenLocked() && + if (shell->IsScreenLocked() && actions_allowed_at_lock_screen_.find(action) == actions_allowed_at_lock_screen_.end()) { return false; diff --git a/ash/accelerators/nested_dispatcher_controller_unittest.cc b/ash/accelerators/nested_dispatcher_controller_unittest.cc index ecc7972..3cf1721 100644 --- a/ash/accelerators/nested_dispatcher_controller_unittest.cc +++ b/ash/accelerators/nested_dispatcher_controller_unittest.cc @@ -3,8 +3,8 @@ // found in the LICENSE file. #include "ash/accelerators/accelerator_controller.h" -#include "ash/session_state_delegate.h" #include "ash/shell.h" +#include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" #include "base/bind.h" @@ -109,7 +109,7 @@ TEST_F(NestedDispatcherTest, AssociatedWindowBelowLockScreen) { MockDispatcher inner_dispatcher; scoped_ptr<aura::Window> associated_window(CreateTestWindowInShellWithId(0)); - Shell::GetInstance()->session_state_delegate()->LockScreen(); + Shell::GetInstance()->delegate()->LockScreen(); DispatchKeyReleaseA(); aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); aura::client::GetDispatcherClient(root_window)->RunWithDispatcher( @@ -117,7 +117,7 @@ TEST_F(NestedDispatcherTest, AssociatedWindowBelowLockScreen) { associated_window.get(), true /* nestable_tasks_allowed */); EXPECT_EQ(0, inner_dispatcher.num_key_events_dispatched()); - Shell::GetInstance()->session_state_delegate()->UnlockScreen(); + Shell::GetInstance()->delegate()->UnlockScreen(); } // Aura window above lock screen in z order. |