summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
Diffstat (limited to 'ash')
-rw-r--r--ash/accelerators/nested_dispatcher_controller_unittest.cc13
-rw-r--r--ash/ash.gyp8
-rw-r--r--ash/shell.cc10
-rw-r--r--ash/shell.h2
-rw-r--r--ash/shell/app_list.cc4
-rw-r--r--ash/shell/launcher_delegate_impl.cc54
-rw-r--r--ash/shell/launcher_delegate_impl.h47
-rw-r--r--ash/shell/lock_view.cc46
-rw-r--r--ash/shell/shell_delegate_impl.cc92
-rw-r--r--ash/shell/shell_delegate_impl.h56
-rw-r--r--ash/shell/shell_main.cc205
-rw-r--r--ash/shell/window_type_launcher.cc4
-rw-r--r--ash/shell/window_watcher.cc75
-rw-r--r--ash/shell/window_watcher.h52
-rw-r--r--ash/shell_delegate.h10
-rw-r--r--ash/shell_unittest.cc42
-rw-r--r--ash/test/test_shell_delegate.cc13
-rw-r--r--ash/test/test_shell_delegate.h6
-rw-r--r--ash/wm/event_client_impl.cc40
-rw-r--r--ash/wm/event_client_impl.h37
-rw-r--r--ash/wm/system_modal_container_layout_manager_unittest.cc4
-rw-r--r--ash/wm/window_cycle_controller_unittest.cc12
22 files changed, 555 insertions, 277 deletions
diff --git a/ash/accelerators/nested_dispatcher_controller_unittest.cc b/ash/accelerators/nested_dispatcher_controller_unittest.cc
index c0a2e4f..905b353 100644
--- a/ash/accelerators/nested_dispatcher_controller_unittest.cc
+++ b/ash/accelerators/nested_dispatcher_controller_unittest.cc
@@ -4,6 +4,7 @@
#include "ash/accelerators/accelerator_controller.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"
@@ -114,14 +115,10 @@ TEST_F(NestedDispatcherTest, AssociatedWindowBelowLockScreen) {
MockDispatcher inner_dispatcher;
aura::Window* default_container = Shell::GetInstance()->GetContainer(
internal::kShellWindowId_DefaultContainer);
- scoped_ptr<aura::Window>associated_window(aura::test::CreateTestWindowWithId(
+ scoped_ptr<aura::Window> associated_window(aura::test::CreateTestWindowWithId(
0, default_container));
- scoped_ptr<aura::Window>mock_lock_container(
- aura::test::CreateTestWindowWithId(0, default_container));
- mock_lock_container->set_stops_event_propagation(true);
- aura::test::CreateTestWindowWithId(0, mock_lock_container.get());
- EXPECT_TRUE(aura::test::WindowIsAbove(mock_lock_container.get(),
- associated_window.get()));
+
+ Shell::GetInstance()->delegate()->LockScreen();
DispatchKeyReleaseA();
aura::RootWindow* root_window = ash::Shell::GetInstance()->GetRootWindow();
aura::client::GetDispatcherClient(root_window)->RunWithDispatcher(
@@ -129,6 +126,7 @@ TEST_F(NestedDispatcherTest, AssociatedWindowBelowLockScreen) {
associated_window.get(),
true /* nestable_tasks_allowed */);
EXPECT_EQ(0, inner_dispatcher.num_key_events_dispatched());
+ Shell::GetInstance()->delegate()->UnlockScreen();
}
// Aura window above lock screen in z order.
@@ -139,7 +137,6 @@ TEST_F(NestedDispatcherTest, AssociatedWindowAboveLockScreen) {
internal::kShellWindowId_DefaultContainer);
scoped_ptr<aura::Window>mock_lock_container(
aura::test::CreateTestWindowWithId(0, default_container));
- mock_lock_container->set_stops_event_propagation(true);
aura::test::CreateTestWindowWithId(0, mock_lock_container.get());
scoped_ptr<aura::Window>associated_window(aura::test::CreateTestWindowWithId(
0, default_container));
diff --git a/ash/ash.gyp b/ash/ash.gyp
index 650197a..97fdf72 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -188,6 +188,8 @@
'wm/default_window_resizer.h',
'wm/dialog_frame_view.cc',
'wm/dialog_frame_view.h',
+ 'wm/event_client_impl.cc',
+ 'wm/event_client_impl.h',
'wm/frame_painter.cc',
'wm/frame_painter.h',
'wm/image_grid.cc',
@@ -425,9 +427,13 @@
'shell/app_list.cc',
'shell/bubble.cc',
'shell/example_factory.h',
+ 'shell/launcher_delegate_impl.cc',
+ 'shell/launcher_delegate_impl.h',
'shell/lock_view.cc',
'shell/panel_window.cc',
'shell/panel_window.h',
+ 'shell/shell_delegate_impl.cc',
+ 'shell/shell_delegate_impl.h',
'shell/shell_main.cc',
'shell/shell_main_parts.cc',
'shell/shell_main_parts.h',
@@ -437,6 +443,8 @@
'shell/widgets.cc',
'shell/window_type_launcher.cc',
'shell/window_type_launcher.h',
+ 'shell/window_watcher.cc',
+ 'shell/window_watcher.h',
'<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources_standard/ui_resources_standard.rc',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources.rc',
diff --git a/ash/shell.cc b/ash/shell.cc
index 406d3a8..afefa93 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -42,6 +42,7 @@
#include "ash/wm/base_layout_manager.h"
#include "ash/wm/custom_frame_view_ash.h"
#include "ash/wm/dialog_frame_view.h"
+#include "ash/wm/event_client_impl.h"
#include "ash/wm/panel_window_event_filter.h"
#include "ash/wm/panel_layout_manager.h"
#include "ash/wm/partial_screenshot_event_filter.h"
@@ -190,7 +191,7 @@ void CreateSpecialContainers(aura::RootWindow* root_window) {
lock_screen_containers);
lock_container->SetLayoutManager(
new internal::BaseLayoutManager(root_window));
- lock_container->set_stops_event_propagation(true);
+ // TODO(beng): stopsevents
aura::Window* lock_modal_container = CreateContainer(
internal::kShellWindowId_LockSystemModalContainer,
@@ -520,6 +521,7 @@ Shell::~Shell() {
resize_shadow_controller_.reset();
shadow_controller_.reset();
window_cycle_controller_.reset();
+ event_client_.reset();
monitor_controller_.reset();
// Launcher widget has a InputMethodBridge that references to
@@ -606,6 +608,8 @@ void Shell::Init() {
root_window_layout_ = new internal::RootWindowLayoutManager(root_window);
root_window->SetLayoutManager(root_window_layout_);
+ event_client_.reset(new internal::EventClientImpl(root_window));
+
if (delegate_.get())
status_widget_ = delegate_->CreateStatusArea();
@@ -743,9 +747,7 @@ void Shell::ToggleAppList() {
}
bool Shell::IsScreenLocked() const {
- const aura::Window* lock_screen_container = GetContainer(
- internal::kShellWindowId_LockScreenContainer);
- return lock_screen_container->StopsEventPropagation();
+ return !delegate_.get() || delegate_->IsScreenLocked();
}
bool Shell::IsModalWindowOpen() const {
diff --git a/ash/shell.h b/ash/shell.h
index 23a13cd..764587f 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -60,6 +60,7 @@ class ActivationController;
class AcceleratorFilter;
class AppList;
class DragDropController;
+class EventClientImpl;
class FocusCycler;
class InputMethodEventFilter;
class MonitorController;
@@ -283,6 +284,7 @@ class ASH_EXPORT Shell {
scoped_ptr<VideoDetector> video_detector_;
scoped_ptr<WindowCycleController> window_cycle_controller_;
scoped_ptr<internal::FocusCycler> focus_cycler_;
+ scoped_ptr<internal::EventClientImpl> event_client_;
scoped_ptr<internal::MonitorController> monitor_controller_;
// An event filter that pre-handles all key events to send them to an IME.
diff --git a/ash/shell/app_list.cc b/ash/shell/app_list.cc
index 80ff70e..2003b32 100644
--- a/ash/shell/app_list.cc
+++ b/ash/shell/app_list.cc
@@ -7,6 +7,8 @@
#include "ash/app_list/app_list_model.h"
#include "ash/app_list/app_list_view_delegate.h"
#include "ash/app_list/app_list_view.h"
+#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/shell/example_factory.h"
#include "ash/shell/toplevel_window.h"
#include "base/basictypes.h"
@@ -80,7 +82,7 @@ class WindowTypeLauncherItem : public ash::AppListItemModel {
break;
}
case LOCK_SCREEN: {
- CreateLockScreen();
+ Shell::GetInstance()->delegate()->LockScreen();
break;
}
case WIDGETS_WINDOW: {
diff --git a/ash/shell/launcher_delegate_impl.cc b/ash/shell/launcher_delegate_impl.cc
new file mode 100644
index 0000000..b5f6e7f
--- /dev/null
+++ b/ash/shell/launcher_delegate_impl.cc
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 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/shell/launcher_delegate_impl.h"
+
+#include "ash/shell/toplevel_window.h"
+#include "ash/shell/window_watcher.h"
+#include "ash/wm/window_util.h"
+#include "grit/ui_resources.h"
+#include "ui/aura/window.h"
+
+namespace ash {
+namespace shell {
+
+LauncherDelegateImpl::LauncherDelegateImpl(WindowWatcher* watcher)
+ : watcher_(watcher) {
+}
+
+LauncherDelegateImpl::~LauncherDelegateImpl() {
+}
+
+void LauncherDelegateImpl::CreateNewWindow() {
+ ash::shell::ToplevelWindow::CreateParams create_params;
+ create_params.can_resize = true;
+ create_params.can_maximize = true;
+ ash::shell::ToplevelWindow::CreateToplevelWindow(create_params);
+}
+
+void LauncherDelegateImpl::ItemClicked(const ash::LauncherItem& item) {
+ aura::Window* window = watcher_->GetWindowByID(item.id);
+ window->Show();
+ ash::wm::ActivateWindow(window);
+}
+
+int LauncherDelegateImpl::GetBrowserShortcutResourceId() {
+ return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT;
+}
+
+string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) {
+ return watcher_->GetWindowByID(item.id)->title();
+}
+
+ui::MenuModel* LauncherDelegateImpl::CreateContextMenu(
+ const ash::LauncherItem& item) {
+ return NULL;
+}
+
+ash::LauncherID LauncherDelegateImpl::GetIDByWindow(aura::Window* window) {
+ return watcher_->GetIDByWindow(window);
+}
+
+} // namespace shell
+} // namespace ash
diff --git a/ash/shell/launcher_delegate_impl.h b/ash/shell/launcher_delegate_impl.h
new file mode 100644
index 0000000..425e4cfd
--- /dev/null
+++ b/ash/shell/launcher_delegate_impl.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 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_SHELL_LAUNCHER_DELEGATE_IMPL_H_
+#define ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_
+#pragma once
+
+#include "ash/launcher/launcher_delegate.h"
+#include "base/compiler_specific.h"
+
+namespace aura {
+class Window;
+}
+
+namespace ash {
+namespace shell {
+
+class WindowWatcher;
+
+class LauncherDelegateImpl : public ash::LauncherDelegate {
+ public:
+ explicit LauncherDelegateImpl(WindowWatcher* watcher);
+ virtual ~LauncherDelegateImpl();
+
+ void set_watcher(WindowWatcher* watcher) { watcher_ = watcher; }
+
+ // LauncherDelegate overrides:
+ virtual void CreateNewWindow() OVERRIDE;
+ virtual void ItemClicked(const ash::LauncherItem& item) OVERRIDE;
+ virtual int GetBrowserShortcutResourceId() OVERRIDE;
+ virtual string16 GetTitle(const ash::LauncherItem& item) OVERRIDE;
+ virtual ui::MenuModel* CreateContextMenu(
+ const ash::LauncherItem& item) OVERRIDE;
+ virtual ash::LauncherID GetIDByWindow(aura::Window* window) OVERRIDE;
+
+ private:
+ // Used to update Launcher. Owned by main.
+ WindowWatcher* watcher_;
+
+ DISALLOW_COPY_AND_ASSIGN(LauncherDelegateImpl);
+};
+
+} // namespace shell
+} // namespace ash
+
+#endif // ASH_SHELL_LAUNCHER_DELEGATE_IMPL_H_
diff --git a/ash/shell/lock_view.cc b/ash/shell/lock_view.cc
index c8a4d82..a604e89 100644
--- a/ash/shell/lock_view.cc
+++ b/ash/shell/lock_view.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/shell/example_factory.h"
#include "ash/tooltips/tooltip_controller.h"
@@ -11,6 +12,7 @@
#include "ui/aura/window.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
+#include "ui/views/controls/button/text_button.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@@ -19,18 +21,23 @@ using ash::Shell;
namespace ash {
namespace shell {
-class LockView : public views::WidgetDelegateView {
+class LockView : public views::WidgetDelegateView,
+ public views::ButtonListener {
public:
- LockView() {}
+ LockView() : unlock_button_(ALLOW_THIS_IN_INITIALIZER_LIST(
+ new views::NativeTextButton(this, ASCIIToUTF16("Unlock")))) {
+ AddChildView(unlock_button_);
+ unlock_button_->set_focusable(true);
+ }
virtual ~LockView() {}
- // Overridden from View:
+ // Overridden from views::View:
virtual gfx::Size GetPreferredSize() OVERRIDE {
return gfx::Size(500, 400);
}
private:
- // Overridden from View:
+ // Overridden from views::View:
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
canvas->FillRect(GetLocalBounds(), SK_ColorYELLOW);
string16 text = ASCIIToUTF16("LOCKED!");
@@ -39,14 +46,35 @@ class LockView : public views::WidgetDelegateView {
(height() - font_.GetHeight()) / 2,
string_width, font_.GetHeight());
}
- virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE {
- return true;
+ virtual void Layout() OVERRIDE {
+ gfx::Rect bounds = GetLocalBounds();
+ gfx::Size ps = unlock_button_->GetPreferredSize();
+ bounds.set_y(bounds.bottom() - ps.height() - 5);
+ bounds.set_x((bounds.width() - ps.width()) / 2);
+ bounds.set_size(ps);
+ unlock_button_->SetBoundsRect(bounds);
+ }
+ virtual void ViewHierarchyChanged(bool is_add,
+ views::View* parent,
+ views::View* child) OVERRIDE {
+ if (is_add && child == this)
+ unlock_button_->RequestFocus();
}
- virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE {
+
+ // Overridden from views::WidgetDelegateView:
+ virtual void WindowClosing() OVERRIDE {
+ Shell::GetInstance()->delegate()->UnlockScreen();
+ }
+
+ // Overridden from views::ButtonListener:
+ virtual void ButtonPressed(views::Button* sender,
+ const views::Event& event) OVERRIDE {
+ DCHECK(sender == unlock_button_);
GetWidget()->Close();
}
gfx::Font font_;
+ views::NativeTextButton* unlock_button_;
DISALLOW_COPY_AND_ASSIGN(LockView);
};
@@ -54,7 +82,8 @@ class LockView : public views::WidgetDelegateView {
void CreateLockScreen() {
LockView* lock_view = new LockView;
views::Widget* widget = new views::Widget;
- views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
+ views::Widget::InitParams params(
+ views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
gfx::Size ps = lock_view->GetPreferredSize();
gfx::Size root_window_size = Shell::GetRootWindow()->bounds().size();
@@ -69,6 +98,7 @@ void CreateLockScreen() {
widget->SetContentsView(lock_view);
widget->Show();
widget->GetNativeView()->SetName("LockView");
+ widget->GetNativeView()->Focus();
Shell::GetInstance()->tooltip_controller()->UpdateTooltip(
widget->GetNativeView());
diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc
new file mode 100644
index 0000000..2fb2c27a
--- /dev/null
+++ b/ash/shell/shell_delegate_impl.cc
@@ -0,0 +1,92 @@
+// Copyright (c) 2012 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/shell/shell_delegate_impl.h"
+
+#include "ash/shell/example_factory.h"
+#include "ash/shell/launcher_delegate_impl.h"
+#include "ash/shell_window_ids.h"
+#include "ash/wm/partial_screenshot_view.h"
+#include "base/message_loop.h"
+#include "ui/aura/window.h"
+
+namespace ash {
+namespace shell {
+
+ShellDelegateImpl::ShellDelegateImpl()
+ : watcher_(NULL),
+ launcher_delegate_(NULL),
+ locked_(false) {
+}
+
+ShellDelegateImpl::~ShellDelegateImpl() {
+}
+
+void ShellDelegateImpl::SetWatcher(WindowWatcher* watcher) {
+ watcher_ = watcher;
+ if (launcher_delegate_)
+ launcher_delegate_->set_watcher(watcher);
+}
+
+views::Widget* ShellDelegateImpl::CreateStatusArea() {
+ return NULL;
+}
+
+bool ShellDelegateImpl::CanCreateLauncher() {
+ return true;
+}
+
+void ShellDelegateImpl::LockScreen() {
+ ash::shell::CreateLockScreen();
+ locked_ = true;
+}
+
+void ShellDelegateImpl::UnlockScreen() {
+ locked_ = false;
+}
+
+bool ShellDelegateImpl::IsScreenLocked() const {
+ return locked_;
+}
+
+void ShellDelegateImpl::Exit() {
+ MessageLoopForUI::current()->Quit();
+}
+
+ash::AppListViewDelegate* ShellDelegateImpl::CreateAppListViewDelegate() {
+ return ash::shell::CreateAppListViewDelegate();
+}
+
+std::vector<aura::Window*> ShellDelegateImpl::GetCycleWindowList(
+ CycleSource source) const {
+ aura::Window* default_container = ash::Shell::GetInstance()->GetContainer(
+ ash::internal::kShellWindowId_DefaultContainer);
+ std::vector<aura::Window*> windows = default_container->children();
+ // Window cycling expects the topmost window at the front of the list.
+ std::reverse(windows.begin(), windows.end());
+ return windows;
+}
+
+void ShellDelegateImpl::StartPartialScreenshot(
+ ash::ScreenshotDelegate* screenshot_delegate) {
+ ash::PartialScreenshotView::StartPartialScreenshot(screenshot_delegate);
+}
+
+ash::LauncherDelegate* ShellDelegateImpl::CreateLauncherDelegate(
+ ash::LauncherModel* model) {
+ launcher_delegate_ = new LauncherDelegateImpl(watcher_);
+ return launcher_delegate_;
+}
+
+ash::SystemTrayDelegate* ShellDelegateImpl::CreateSystemTrayDelegate(
+ ash::SystemTray* tray) {
+ return NULL;
+}
+
+ash::UserWallpaperDelegate* ShellDelegateImpl::CreateUserWallpaperDelegate() {
+ return NULL;
+}
+
+} // namespace shell
+} // namespace ash
diff --git a/ash/shell/shell_delegate_impl.h b/ash/shell/shell_delegate_impl.h
new file mode 100644
index 0000000..797011b
--- /dev/null
+++ b/ash/shell/shell_delegate_impl.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2012 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_SHELL_SHELL_DELEGATE_IMPL_H_
+#define ASH_SHELL_SHELL_DELEGATE_IMPL_H_
+#pragma once
+
+#include "ash/shell_delegate.h"
+#include "base/compiler_specific.h"
+
+namespace ash {
+namespace shell {
+
+class LauncherDelegateImpl;
+class WindowWatcher;
+
+class ShellDelegateImpl : public ash::ShellDelegate {
+ public:
+ ShellDelegateImpl();
+ virtual ~ShellDelegateImpl();
+
+ void SetWatcher(WindowWatcher* watcher);
+
+ virtual views::Widget* CreateStatusArea() OVERRIDE;
+ virtual bool CanCreateLauncher() OVERRIDE;
+ virtual void LockScreen() OVERRIDE;
+ virtual void UnlockScreen() OVERRIDE;
+ virtual bool IsScreenLocked() const OVERRIDE;
+ virtual void Exit() OVERRIDE;
+ virtual ash::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE;
+ virtual std::vector<aura::Window*> GetCycleWindowList(
+ CycleSource source) const OVERRIDE;
+ virtual void StartPartialScreenshot(
+ ash::ScreenshotDelegate* screenshot_delegate) OVERRIDE;
+ virtual ash::LauncherDelegate* CreateLauncherDelegate(
+ ash::LauncherModel* model) OVERRIDE;
+ virtual ash::SystemTrayDelegate* CreateSystemTrayDelegate(
+ ash::SystemTray* tray) OVERRIDE;
+ virtual ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE;
+
+ private:
+ // Used to update Launcher. Owned by main.
+ WindowWatcher* watcher_;
+
+ LauncherDelegateImpl* launcher_delegate_;
+
+ bool locked_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShellDelegateImpl);
+};
+
+} // namespace shell
+} // namespace ash
+
+#endif // ASH_SHELL_SHELL_DELEGATE_IMPL_H_
diff --git a/ash/shell/shell_main.cc b/ash/shell/shell_main.cc
index ee62358..3a5c699 100644
--- a/ash/shell/shell_main.cc
+++ b/ash/shell/shell_main.cc
@@ -12,16 +12,14 @@
#include "ash/shell_delegate.h"
#include "ash/shell_factory.h"
#include "ash/shell_window_ids.h"
-#include "ash/shell/example_factory.h"
-#include "ash/shell/toplevel_window.h"
+#include "ash/shell/launcher_delegate_impl.h"
+#include "ash/shell/shell_delegate_impl.h"
#include "ash/shell/shell_main_parts.h"
-#include "ash/wm/partial_screenshot_view.h"
-#include "ash/wm/window_util.h"
+#include "ash/shell/window_watcher.h"
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
-#include "grit/ui_resources.h"
#include "ui/aura/env.h"
#include "ui/aura/client/window_types.h"
#include "ui/aura/root_window.h"
@@ -55,198 +53,6 @@ class ShellViewsDelegate : public views::TestViewsDelegate {
DISALLOW_COPY_AND_ASSIGN(ShellViewsDelegate);
};
-// WindowWatcher is responsible for listening for newly created windows and
-// creating items on the Launcher for them.
-class WindowWatcher : public aura::WindowObserver {
- public:
- WindowWatcher()
- : window_(ash::Shell::GetInstance()->launcher()->window_container()) {
- window_->AddObserver(this);
- }
-
- virtual ~WindowWatcher() {
- window_->RemoveObserver(this);
- }
-
- aura::Window* GetWindowByID(ash::LauncherID id) {
- IDToWindow::const_iterator i = id_to_window_.find(id);
- return i != id_to_window_.end() ? i->second : NULL;
- }
-
- ash::LauncherID GetIDByWindow(aura::Window* window) const {
- for (IDToWindow::const_iterator i = id_to_window_.begin();
- i != id_to_window_.end(); ++i) {
- if (i->second == window)
- return i->first;
- }
- return 0; // TODO: add a constant for this.
- }
-
- // aura::WindowObserver overrides:
- virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE {
- if (new_window->type() != aura::client::WINDOW_TYPE_NORMAL)
- return;
-
- static int image_count = 0;
- ash::LauncherModel* model = ash::Shell::GetInstance()->launcher()->model();
- ash::LauncherItem item;
- item.type = ash::TYPE_TABBED;
- id_to_window_[model->next_id()] = new_window;
- item.num_tabs = image_count + 1;
- item.image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
- item.image.allocPixels();
- item.image.eraseARGB(255,
- image_count == 0 ? 255 : 0,
- image_count == 1 ? 255 : 0,
- image_count == 2 ? 255 : 0);
- image_count = (image_count + 1) % 3;
- model->Add(model->item_count(), item);
- }
-
- virtual void OnWillRemoveWindow(aura::Window* window) OVERRIDE {
- for (IDToWindow::iterator i = id_to_window_.begin();
- i != id_to_window_.end(); ++i) {
- if (i->second == window) {
- ash::LauncherModel* model =
- ash::Shell::GetInstance()->launcher()->model();
- int index = model->ItemIndexByID(i->first);
- DCHECK_NE(-1, index);
- model->RemoveItemAt(index);
- id_to_window_.erase(i);
- break;
- }
- }
- }
-
- private:
- typedef std::map<ash::LauncherID, aura::Window*> IDToWindow;
-
- // Window watching for newly created windows to be added to.
- aura::Window* window_;
-
- // Maps from window to the id we gave it.
- IDToWindow id_to_window_;
-
- DISALLOW_COPY_AND_ASSIGN(WindowWatcher);
-};
-
-class LauncherDelegateImpl : public ash::LauncherDelegate {
- public:
- explicit LauncherDelegateImpl(WindowWatcher* watcher)
- : watcher_(watcher) {
- }
-
- void set_watcher(WindowWatcher* watcher) { watcher_ = watcher; }
-
- // LauncherDelegate overrides:
- virtual void CreateNewWindow() OVERRIDE {
- ash::shell::ToplevelWindow::CreateParams create_params;
- create_params.can_resize = true;
- create_params.can_maximize = true;
- ash::shell::ToplevelWindow::CreateToplevelWindow(create_params);
- }
-
- virtual void ItemClicked(const ash::LauncherItem& item) OVERRIDE {
- aura::Window* window = watcher_->GetWindowByID(item.id);
- window->Show();
- ash::wm::ActivateWindow(window);
- }
-
- virtual int GetBrowserShortcutResourceId() OVERRIDE {
- return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT;
- }
-
- virtual string16 GetTitle(const ash::LauncherItem& item) OVERRIDE {
- return watcher_->GetWindowByID(item.id)->title();
- }
-
- virtual ui::MenuModel* CreateContextMenu(
- const ash::LauncherItem& item) OVERRIDE {
- return NULL;
- }
-
- virtual ash::LauncherID GetIDByWindow(aura::Window* window) OVERRIDE {
- return watcher_->GetIDByWindow(window);
- }
-
- private:
- // Used to update Launcher. Owned by main.
- WindowWatcher* watcher_;
-
- DISALLOW_COPY_AND_ASSIGN(LauncherDelegateImpl);
-};
-
-class ShellDelegateImpl : public ash::ShellDelegate {
- public:
- ShellDelegateImpl() : watcher_(NULL), launcher_delegate_(NULL) {}
-
- void SetWatcher(WindowWatcher* watcher) {
- watcher_ = watcher;
- if (launcher_delegate_)
- launcher_delegate_->set_watcher(watcher);
- }
-
- virtual views::Widget* CreateStatusArea() OVERRIDE {
- return NULL;
- }
-
- virtual bool CanCreateLauncher() OVERRIDE {
- return true;
- }
-
-#if defined(OS_CHROMEOS)
- virtual void LockScreen() OVERRIDE {
- ash::shell::CreateLockScreen();
- }
-#endif
-
- virtual void Exit() OVERRIDE {
- MessageLoopForUI::current()->Quit();
- }
-
- virtual ash::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE {
- return ash::shell::CreateAppListViewDelegate();
- }
-
- std::vector<aura::Window*> GetCycleWindowList(
- CycleSource source) const OVERRIDE {
- aura::Window* default_container = ash::Shell::GetInstance()->GetContainer(
- ash::internal::kShellWindowId_DefaultContainer);
- std::vector<aura::Window*> windows = default_container->children();
- // Window cycling expects the topmost window at the front of the list.
- std::reverse(windows.begin(), windows.end());
- return windows;
- }
-
- virtual void StartPartialScreenshot(
- ash::ScreenshotDelegate* screenshot_delegate) OVERRIDE {
- ash::PartialScreenshotView::StartPartialScreenshot(screenshot_delegate);
- }
-
- virtual ash::LauncherDelegate* CreateLauncherDelegate(
- ash::LauncherModel* model) OVERRIDE {
- launcher_delegate_ = new LauncherDelegateImpl(watcher_);
- return launcher_delegate_;
- }
-
- virtual ash::SystemTrayDelegate* CreateSystemTrayDelegate(
- ash::SystemTray* tray) {
- return NULL;
- }
-
- virtual ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() {
- return NULL;
- }
-
- private:
- // Used to update Launcher. Owned by main.
- WindowWatcher* watcher_;
-
- LauncherDelegateImpl* launcher_delegate_;
-
- DISALLOW_COPY_AND_ASSIGN(ShellDelegateImpl);
-};
-
} // namespace
namespace ash {
@@ -273,10 +79,11 @@ int main(int argc, char** argv) {
if (!views::ViewsDelegate::views_delegate)
views::ViewsDelegate::views_delegate = new ShellViewsDelegate;
- ShellDelegateImpl* delegate = new ShellDelegateImpl;
+ ash::shell::ShellDelegateImpl* delegate = new ash::shell::ShellDelegateImpl;
ash::Shell::CreateInstance(delegate);
- scoped_ptr<WindowWatcher> window_watcher(new WindowWatcher);
+ scoped_ptr<ash::shell::WindowWatcher> window_watcher(
+ new ash::shell::WindowWatcher);
delegate->SetWatcher(window_watcher.get());
ash::shell::InitWindowTypeLauncher();
diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc
index 9efd285..61d0d9c 100644
--- a/ash/shell/window_type_launcher.cc
+++ b/ash/shell/window_type_launcher.cc
@@ -4,6 +4,8 @@
#include "ash/shell/window_type_launcher.h"
+#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/shell/example_factory.h"
#include "ash/shell/panel_window.h"
@@ -323,7 +325,7 @@ void WindowTypeLauncher::ButtonPressed(views::Button* sender,
} else if (sender == bubble_button_) {
CreatePointyBubble(sender);
} else if (sender == lock_button_) {
- CreateLockScreen();
+ Shell::GetInstance()->delegate()->LockScreen();
} else if (sender == widgets_button_) {
CreateWidgetsWindow();
} else if (sender == system_modal_button_) {
diff --git a/ash/shell/window_watcher.cc b/ash/shell/window_watcher.cc
new file mode 100644
index 0000000..05c4f74
--- /dev/null
+++ b/ash/shell/window_watcher.cc
@@ -0,0 +1,75 @@
+// Copyright (c) 2012 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/shell/window_watcher.h"
+
+#include "ash/launcher/launcher.h"
+#include "ash/launcher/launcher_model.h"
+#include "ash/shell.h"
+#include "ui/aura/window.h"
+
+namespace ash {
+namespace shell {
+
+WindowWatcher::WindowWatcher()
+ : window_(ash::Shell::GetInstance()->launcher()->window_container()) {
+ window_->AddObserver(this);
+}
+
+WindowWatcher::~WindowWatcher() {
+ window_->RemoveObserver(this);
+}
+
+aura::Window* WindowWatcher::GetWindowByID(ash::LauncherID id) {
+ IDToWindow::const_iterator i = id_to_window_.find(id);
+ return i != id_to_window_.end() ? i->second : NULL;
+}
+
+ash::LauncherID WindowWatcher::GetIDByWindow(aura::Window* window) const {
+ for (IDToWindow::const_iterator i = id_to_window_.begin();
+ i != id_to_window_.end(); ++i) {
+ if (i->second == window)
+ return i->first;
+ }
+ return 0; // TODO: add a constant for this.
+}
+
+// aura::WindowObserver overrides:
+void WindowWatcher::OnWindowAdded(aura::Window* new_window) {
+ if (new_window->type() != aura::client::WINDOW_TYPE_NORMAL)
+ return;
+
+ static int image_count = 0;
+ ash::LauncherModel* model = ash::Shell::GetInstance()->launcher()->model();
+ ash::LauncherItem item;
+ item.type = ash::TYPE_TABBED;
+ id_to_window_[model->next_id()] = new_window;
+ item.num_tabs = image_count + 1;
+ item.image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
+ item.image.allocPixels();
+ item.image.eraseARGB(255,
+ image_count == 0 ? 255 : 0,
+ image_count == 1 ? 255 : 0,
+ image_count == 2 ? 255 : 0);
+ image_count = (image_count + 1) % 3;
+ model->Add(model->item_count(), item);
+}
+
+void WindowWatcher::OnWillRemoveWindow(aura::Window* window) {
+ for (IDToWindow::iterator i = id_to_window_.begin();
+ i != id_to_window_.end(); ++i) {
+ if (i->second == window) {
+ ash::LauncherModel* model =
+ ash::Shell::GetInstance()->launcher()->model();
+ int index = model->ItemIndexByID(i->first);
+ DCHECK_NE(-1, index);
+ model->RemoveItemAt(index);
+ id_to_window_.erase(i);
+ break;
+ }
+ }
+}
+
+} // namespace shell
+} // namespace ash
diff --git a/ash/shell/window_watcher.h b/ash/shell/window_watcher.h
new file mode 100644
index 0000000..d36a4c8
--- /dev/null
+++ b/ash/shell/window_watcher.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2012 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_SHELL_WINDOW_WATCHER_H_
+#define ASH_SHELL_WINDOW_WATCHER_H_
+#pragma once
+
+#include <map>
+
+#include "ash/launcher/launcher_types.h"
+#include "base/compiler_specific.h"
+#include "base/logging.h"
+#include "ui/aura/window_observer.h"
+
+namespace aura {
+class Window;
+}
+
+namespace ash {
+namespace shell {
+
+// WindowWatcher is responsible for listening for newly created windows and
+// creating items on the Launcher for them.
+class WindowWatcher : public aura::WindowObserver {
+ public:
+ WindowWatcher();
+ virtual ~WindowWatcher();
+
+ aura::Window* GetWindowByID(ash::LauncherID id);
+ ash::LauncherID GetIDByWindow(aura::Window* window) const;
+
+ // aura::WindowObserver overrides:
+ virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE;
+ virtual void OnWillRemoveWindow(aura::Window* window) OVERRIDE;
+
+ private:
+ typedef std::map<ash::LauncherID, aura::Window*> IDToWindow;
+
+ // Window watching for newly created windows to be added to.
+ aura::Window* window_;
+
+ // Maps from window to the id we gave it.
+ IDToWindow id_to_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowWatcher);
+};
+
+} // namespace shell
+} // namespace ash
+
+#endif // ASH_SHELL_WINDOW_WATCHER_H_
diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h
index abcb72a..d6bc931 100644
--- a/ash/shell_delegate.h
+++ b/ash/shell_delegate.h
@@ -54,10 +54,14 @@ class ASH_EXPORT ShellDelegate {
// until e.g. a user has logged in and their profile has been loaded.
virtual bool CanCreateLauncher() = 0;
-#if defined(OS_CHROMEOS)
- // Invoked when a user uses Ctrl-Shift-L to lock the screen.
+ // Invoked when a user locks the screen.
virtual void LockScreen() = 0;
-#endif
+
+ // Unlock the screen. Currently used only for tests.
+ virtual void UnlockScreen() = 0;
+
+ // Returns true if the screen is currently locked.
+ virtual bool IsScreenLocked() const = 0;
// Invoked when a user uses Ctrl-Shift-Q to close chrome.
virtual void Exit() = 0;
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 9f5ff3a..d4dd7ea 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -5,6 +5,7 @@
#include "ash/ash_switches.h"
#include "ash/launcher/launcher.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/root_window_layout_manager.h"
@@ -244,46 +245,9 @@ TEST_F(ShellTest, CreateLockScreenModalWindow) {
}
TEST_F(ShellTest, IsScreenLocked) {
- views::Widget::InitParams widget_params(
- views::Widget::InitParams::TYPE_WINDOW);
-
- // A normal window does not lock the screen.
- views::Widget* widget = CreateTestWindow(widget_params);
- widget->Show();
- EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
- widget->Hide();
- EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
-
- // A modal window with a normal window as parent does not locks the screen.
- views::Widget* modal_widget = views::Widget::CreateWindowWithParent(
- new ModalWindow(), widget->GetNativeView());
- modal_widget->Show();
- EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
- modal_widget->Close();
- EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
- widget->Close();
-
- // A lock screen window locks the screen.
- views::Widget* lock_widget = CreateTestWindow(widget_params);
- ash::Shell::GetInstance()->GetContainer(
- ash::internal::kShellWindowId_LockScreenContainer)->
- AddChild(lock_widget->GetNativeView());
- lock_widget->Show();
- EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
- lock_widget->Hide();
- EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
-
- // A modal window with a lock window as parent does not lock the screen. The
- // screen is locked only when a lock window is visible.
- views::Widget* lock_modal_widget = views::Widget::CreateWindowWithParent(
- new ModalWindow(), lock_widget->GetNativeView());
- lock_modal_widget->Show();
- EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
- lock_widget->Show();
- EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
- lock_modal_widget->Close();
+ ash::Shell::GetInstance()->delegate()->LockScreen();
EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
- lock_widget->Close();
+ ash::Shell::GetInstance()->delegate()->UnlockScreen();
EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
}
diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc
index 3c8de10..49baee5 100644
--- a/ash/test/test_shell_delegate.cc
+++ b/ash/test/test_shell_delegate.cc
@@ -15,7 +15,7 @@
namespace ash {
namespace test {
-TestShellDelegate::TestShellDelegate() {
+TestShellDelegate::TestShellDelegate() : locked_(false) {
}
TestShellDelegate::~TestShellDelegate() {
@@ -29,10 +29,17 @@ bool TestShellDelegate::CanCreateLauncher() {
return true;
}
-#if defined(OS_CHROMEOS)
void TestShellDelegate::LockScreen() {
+ locked_ = true;
+}
+
+void TestShellDelegate::UnlockScreen() {
+ locked_ = false;
+}
+
+bool TestShellDelegate::IsScreenLocked() const {
+ return locked_;
}
-#endif
void TestShellDelegate::Exit() {
}
diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h
index f23517f..72412ffe 100644
--- a/ash/test/test_shell_delegate.h
+++ b/ash/test/test_shell_delegate.h
@@ -20,9 +20,9 @@ class TestShellDelegate : public ShellDelegate {
// Overridden from ShellDelegate:
virtual views::Widget* CreateStatusArea() OVERRIDE;
virtual bool CanCreateLauncher() OVERRIDE;
-#if defined(OS_CHROMEOS)
virtual void LockScreen() OVERRIDE;
-#endif
+ virtual void UnlockScreen() OVERRIDE;
+ virtual bool IsScreenLocked() const OVERRIDE;
virtual void Exit() OVERRIDE;
virtual AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE;
virtual std::vector<aura::Window*> GetCycleWindowList(
@@ -35,6 +35,8 @@ class TestShellDelegate : public ShellDelegate {
virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE;
private:
+ bool locked_;
+
DISALLOW_COPY_AND_ASSIGN(TestShellDelegate);
};
diff --git a/ash/wm/event_client_impl.cc b/ash/wm/event_client_impl.cc
new file mode 100644
index 0000000..58b4385
--- /dev/null
+++ b/ash/wm/event_client_impl.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 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/wm/event_client_impl.h"
+
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+
+namespace ash {
+namespace internal {
+
+EventClientImpl::EventClientImpl(aura::RootWindow* root_window)
+ : root_window_(root_window) {
+ aura::client::SetEventClient(root_window_, this);
+}
+
+EventClientImpl::~EventClientImpl() {
+ aura::client::SetEventClient(root_window_, NULL);
+}
+
+bool EventClientImpl::CanProcessEventsWithinSubtree(
+ const aura::Window* window) const {
+ if (Shell::GetInstance()->IsScreenLocked()) {
+ aura::Window* lock_screen_containers =
+ Shell::GetInstance()->GetContainer(
+ kShellWindowId_LockScreenContainersContainer);
+ aura::Window* lock_screen_related_containers =
+ Shell::GetInstance()->GetContainer(
+ kShellWindowId_LockScreenRelatedContainersContainer);
+ return lock_screen_containers->Contains(window) ||
+ lock_screen_related_containers->Contains(window);
+ }
+ return true;
+}
+
+} // namespace internal
+} // namespace ash
diff --git a/ash/wm/event_client_impl.h b/ash/wm/event_client_impl.h
new file mode 100644
index 0000000..7148664
--- /dev/null
+++ b/ash/wm/event_client_impl.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2012 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_WM_EVENT_CLIENT_IMPL_H_
+#define ASH_WM_EVENT_CLIENT_IMPL_H_
+#pragma once
+
+#include "ash/ash_export.h"
+#include "ui/aura/client/event_client.h"
+
+namespace aura {
+class RootWindow;
+}
+
+namespace ash {
+namespace internal {
+
+class EventClientImpl : public aura::client::EventClient {
+ public:
+ explicit EventClientImpl(aura::RootWindow* root_window);
+ virtual ~EventClientImpl();
+
+ private:
+ // Overridden from aura::client::EventClient:
+ virtual bool CanProcessEventsWithinSubtree(
+ const aura::Window* window) const OVERRIDE;
+
+ aura::RootWindow* root_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventClientImpl);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_WM_EVENT_CLIENT_IMPL_H_
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index a4814e2..6dbb9cf 100644
--- a/ash/wm/system_modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -5,6 +5,7 @@
#include "ash/wm/system_modal_container_layout_manager.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/window_util.h"
@@ -227,6 +228,7 @@ TEST_F(SystemModalContainerLayoutManagerTest,
// Create a window in the lock screen container and ensure that it receives
// the mouse event instead of the modal window (crbug.com/110920).
+ Shell::GetInstance()->delegate()->LockScreen();
EventTestWindow* lock_delegate = new EventTestWindow(false);
scoped_ptr<aura::Window> lock(lock_delegate->OpenTestWindow(
Shell::GetInstance()->GetContainer(
@@ -247,6 +249,8 @@ TEST_F(SystemModalContainerLayoutManagerTest,
EXPECT_EQ(1, transient_delegate->mouse_presses());
EXPECT_EQ(1, lock_delegate->mouse_presses());
EXPECT_EQ(1, lock_modal_delegate->mouse_presses());
+
+ Shell::GetInstance()->delegate()->UnlockScreen();
}
} // namespace test
diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc
index 499acdc..3aaac40 100644
--- a/ash/wm/window_cycle_controller_unittest.cc
+++ b/ash/wm/window_cycle_controller_unittest.cc
@@ -132,21 +132,15 @@ TEST_F(WindowCycleControllerTest, HandleCycleWindow) {
EXPECT_FALSE(controller->IsCycling());
EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
- // When a screen lock window is visible, cycling window does not take effect.
- aura::Window* lock_screen_container =
- Shell::GetInstance()->GetContainer(
- internal::kShellWindowId_LockScreenContainer);
- scoped_ptr<Window> lock_screen_window(
- CreateTestWindowWithId(-1, lock_screen_container));
- lock_screen_window->Show();
+ // When the screen is locked, cycling window does not take effect.
+ Shell::GetInstance()->delegate()->LockScreen();
EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
controller->HandleCycleWindow(WindowCycleController::FORWARD, false);
EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
controller->HandleCycleWindow(WindowCycleController::BACKWARD, false);
EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
- // Hiding the lock screen is equivalent to not being locked.
- lock_screen_window->Hide();
+ Shell::GetInstance()->delegate()->UnlockScreen();
EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
controller->HandleCycleWindow(WindowCycleController::FORWARD, false);
EXPECT_TRUE(wm::IsActiveWindow(window1.get()));