summaryrefslogtreecommitdiffstats
path: root/ash/shell/shell_delegate_impl.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 16:21:17 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 16:21:17 +0000
commite8de9ea15ead4a310e303b86f785433c837e5910 (patch)
tree400fd599de7f09887fa28695186e102a570b7ca8 /ash/shell/shell_delegate_impl.cc
parent5ebd74c164778f697a4deea82bc0fd469c6999fd (diff)
downloadchromium_src-e8de9ea15ead4a310e303b86f785433c837e5910.zip
chromium_src-e8de9ea15ead4a310e303b86f785433c837e5910.tar.gz
chromium_src-e8de9ea15ead4a310e303b86f785433c837e5910.tar.bz2
Remove stops_event_propagation from Window, since it's broken.
Changes it to be implemented by the Aura client, via a new interface EventClient. The client can determine whether or not a given window and its subtree can receive events. I also cleaned up the way screen locking is entered/exited via the delegate, and some stuff in ash/shell. http://crbug.com/119347 TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=128328 Review URL: https://chromiumcodereview.appspot.com/9788001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell/shell_delegate_impl.cc')
-rw-r--r--ash/shell/shell_delegate_impl.cc92
1 files changed, 92 insertions, 0 deletions
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