blob: 7890551fc3488903cc85213a8b9e443f5e33718d [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]cae97652012-04-20 03:12:1252void ShellDelegateImpl::Shutdown() {
[email protected]3528b7d2012-04-18 10:46:3653}
54
[email protected]262f8bd2012-03-23 19:30:2755void ShellDelegateImpl::Exit() {
56 MessageLoopForUI::current()->Quit();
57}
58
[email protected]343dc062012-05-25 03:16:5759void ShellDelegateImpl::NewTab() {
60}
61
[email protected]b77236f72012-03-25 03:07:1962void ShellDelegateImpl::NewWindow(bool incognito) {
63 ash::shell::ToplevelWindow::CreateParams create_params;
64 create_params.can_resize = true;
65 create_params.can_maximize = true;
66 ash::shell::ToplevelWindow::CreateToplevelWindow(create_params);
67}
68
[email protected]cae97652012-04-20 03:12:1269void ShellDelegateImpl::Search() {
70}
71
72void ShellDelegateImpl::OpenFileManager() {
73}
74
75void ShellDelegateImpl::OpenCrosh() {
76}
77
78void ShellDelegateImpl::OpenMobileSetup() {
79}
80
[email protected]343dc062012-05-25 03:16:5781void ShellDelegateImpl::RestoreTab() {
82}
83
[email protected]b509fc32012-05-24 21:56:5684void ShellDelegateImpl::ShowKeyboardOverlay() {
[email protected]e6ae78c32012-05-15 19:14:2485}
86
[email protected]343dc062012-05-25 03:16:5787void ShellDelegateImpl::ShowTaskManager() {
88}
89
[email protected]24af4972012-05-04 19:42:1890content::BrowserContext* ShellDelegateImpl::GetCurrentBrowserContext() {
91 return Shell::GetInstance()->browser_context();
92}
93
[email protected]ce3d7682012-05-02 23:01:4194void ShellDelegateImpl::ToggleSpokenFeedback() {
95}
96
[email protected]0039db92012-05-09 04:11:4597app_list::AppListViewDelegate* ShellDelegateImpl::CreateAppListViewDelegate() {
[email protected]262f8bd2012-03-23 19:30:2798 return ash::shell::CreateAppListViewDelegate();
99}
100
[email protected]262f8bd2012-03-23 19:30:27101void ShellDelegateImpl::StartPartialScreenshot(
102 ash::ScreenshotDelegate* screenshot_delegate) {
103 ash::PartialScreenshotView::StartPartialScreenshot(screenshot_delegate);
104}
105
106ash::LauncherDelegate* ShellDelegateImpl::CreateLauncherDelegate(
107 ash::LauncherModel* model) {
108 launcher_delegate_ = new LauncherDelegateImpl(watcher_);
109 return launcher_delegate_;
110}
111
112ash::SystemTrayDelegate* ShellDelegateImpl::CreateSystemTrayDelegate(
113 ash::SystemTray* tray) {
114 return NULL;
115}
116
117ash::UserWallpaperDelegate* ShellDelegateImpl::CreateUserWallpaperDelegate() {
118 return NULL;
119}
120
121} // namespace shell
122} // namespace ash