blob: 334e5971b8f9c2ed830386d6e31ea4abf3c08a6d [file] [log] [blame]
[email protected]262f8bd2012-03-23 19:30:271// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ash/shell/shell_delegate_impl.h"
6
7#include "ash/shell/example_factory.h"
8#include "ash/shell/launcher_delegate_impl.h"
[email protected]b77236f72012-03-25 03:07:199#include "ash/shell/toplevel_window.h"
[email protected]262f8bd2012-03-23 19:30:2710#include "ash/shell_window_ids.h"
11#include "ash/wm/partial_screenshot_view.h"
12#include "base/message_loop.h"
13#include "ui/aura/window.h"
14
15namespace ash {
16namespace shell {
17
18ShellDelegateImpl::ShellDelegateImpl()
19 : watcher_(NULL),
20 launcher_delegate_(NULL),
21 locked_(false) {
22}
23
24ShellDelegateImpl::~ShellDelegateImpl() {
25}
26
27void ShellDelegateImpl::SetWatcher(WindowWatcher* watcher) {
28 watcher_ = watcher;
29 if (launcher_delegate_)
30 launcher_delegate_->set_watcher(watcher);
31}
32
[email protected]1720a442012-03-25 22:03:4733bool ShellDelegateImpl::IsUserLoggedIn() {
[email protected]262f8bd2012-03-23 19:30:2734 return true;
35}
36
37void ShellDelegateImpl::LockScreen() {
38 ash::shell::CreateLockScreen();
39 locked_ = true;
[email protected]c758fbf2012-03-25 22:53:5940 ash::Shell::GetInstance()->UpdateShelfVisibility();
[email protected]262f8bd2012-03-23 19:30:2741}
42
43void ShellDelegateImpl::UnlockScreen() {
44 locked_ = false;
[email protected]c758fbf2012-03-25 22:53:5945 ash::Shell::GetInstance()->UpdateShelfVisibility();
[email protected]262f8bd2012-03-23 19:30:2746}
47
48bool ShellDelegateImpl::IsScreenLocked() const {
49 return locked_;
50}
51
[email protected]3528b7d2012-04-18 10:46:3652void ShellDelegateImpl::OpenFileManager() {
53}
54
[email protected]262f8bd2012-03-23 19:30:2755void ShellDelegateImpl::Exit() {
56 MessageLoopForUI::current()->Quit();
57}
58
[email protected]b77236f72012-03-25 03:07:1959void ShellDelegateImpl::NewWindow(bool incognito) {
60 ash::shell::ToplevelWindow::CreateParams create_params;
61 create_params.can_resize = true;
62 create_params.can_maximize = true;
63 ash::shell::ToplevelWindow::CreateToplevelWindow(create_params);
64}
65
[email protected]262f8bd2012-03-23 19:30:2766ash::AppListViewDelegate* ShellDelegateImpl::CreateAppListViewDelegate() {
67 return ash::shell::CreateAppListViewDelegate();
68}
69
[email protected]262f8bd2012-03-23 19:30:2770void ShellDelegateImpl::StartPartialScreenshot(
71 ash::ScreenshotDelegate* screenshot_delegate) {
72 ash::PartialScreenshotView::StartPartialScreenshot(screenshot_delegate);
73}
74
75ash::LauncherDelegate* ShellDelegateImpl::CreateLauncherDelegate(
76 ash::LauncherModel* model) {
77 launcher_delegate_ = new LauncherDelegateImpl(watcher_);
78 return launcher_delegate_;
79}
80
81ash::SystemTrayDelegate* ShellDelegateImpl::CreateSystemTrayDelegate(
82 ash::SystemTray* tray) {
83 return NULL;
84}
85
86ash::UserWallpaperDelegate* ShellDelegateImpl::CreateUserWallpaperDelegate() {
87 return NULL;
88}
89
90} // namespace shell
91} // namespace ash