[email protected] | 262f8bd | 2012-03-23 19:30:27 | [diff] [blame] | 1 | // 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] | b77236f7 | 2012-03-25 03:07:19 | [diff] [blame] | 9 | #include "ash/shell/toplevel_window.h" |
[email protected] | 262f8bd | 2012-03-23 19:30:27 | [diff] [blame] | 10 | #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 | |||||
15 | namespace ash { | ||||
16 | namespace shell { | ||||
17 | |||||
18 | ShellDelegateImpl::ShellDelegateImpl() | ||||
19 | : watcher_(NULL), | ||||
20 | launcher_delegate_(NULL), | ||||
21 | locked_(false) { | ||||
22 | } | ||||
23 | |||||
24 | ShellDelegateImpl::~ShellDelegateImpl() { | ||||
25 | } | ||||
26 | |||||
27 | void ShellDelegateImpl::SetWatcher(WindowWatcher* watcher) { | ||||
28 | watcher_ = watcher; | ||||
29 | if (launcher_delegate_) | ||||
30 | launcher_delegate_->set_watcher(watcher); | ||||
31 | } | ||||
32 | |||||
[email protected] | 1720a44 | 2012-03-25 22:03:47 | [diff] [blame] | 33 | bool ShellDelegateImpl::IsUserLoggedIn() { |
[email protected] | 262f8bd | 2012-03-23 19:30:27 | [diff] [blame] | 34 | return true; |
35 | } | ||||
36 | |||||
37 | void ShellDelegateImpl::LockScreen() { | ||||
38 | ash::shell::CreateLockScreen(); | ||||
39 | locked_ = true; | ||||
[email protected] | c758fbf | 2012-03-25 22:53:59 | [diff] [blame] | 40 | ash::Shell::GetInstance()->UpdateShelfVisibility(); |
[email protected] | 262f8bd | 2012-03-23 19:30:27 | [diff] [blame] | 41 | } |
42 | |||||
43 | void ShellDelegateImpl::UnlockScreen() { | ||||
44 | locked_ = false; | ||||
[email protected] | c758fbf | 2012-03-25 22:53:59 | [diff] [blame] | 45 | ash::Shell::GetInstance()->UpdateShelfVisibility(); |
[email protected] | 262f8bd | 2012-03-23 19:30:27 | [diff] [blame] | 46 | } |
47 | |||||
48 | bool ShellDelegateImpl::IsScreenLocked() const { | ||||
49 | return locked_; | ||||
50 | } | ||||
51 | |||||
[email protected] | cae9765 | 2012-04-20 03:12:12 | [diff] [blame] | 52 | void ShellDelegateImpl::Shutdown() { |
[email protected] | 3528b7d | 2012-04-18 10:46:36 | [diff] [blame] | 53 | } |
54 | |||||
[email protected] | 262f8bd | 2012-03-23 19:30:27 | [diff] [blame] | 55 | void ShellDelegateImpl::Exit() { |
56 | MessageLoopForUI::current()->Quit(); | ||||
57 | } | ||||
58 | |||||
[email protected] | 343dc06 | 2012-05-25 03:16:57 | [diff] [blame^] | 59 | void ShellDelegateImpl::NewTab() { |
60 | } | ||||
61 | |||||
[email protected] | b77236f7 | 2012-03-25 03:07:19 | [diff] [blame] | 62 | void 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] | cae9765 | 2012-04-20 03:12:12 | [diff] [blame] | 69 | void ShellDelegateImpl::Search() { |
70 | } | ||||
71 | |||||
72 | void ShellDelegateImpl::OpenFileManager() { | ||||
73 | } | ||||
74 | |||||
75 | void ShellDelegateImpl::OpenCrosh() { | ||||
76 | } | ||||
77 | |||||
78 | void ShellDelegateImpl::OpenMobileSetup() { | ||||
79 | } | ||||
80 | |||||
[email protected] | 343dc06 | 2012-05-25 03:16:57 | [diff] [blame^] | 81 | void ShellDelegateImpl::RestoreTab() { |
82 | } | ||||
83 | |||||
[email protected] | b509fc3 | 2012-05-24 21:56:56 | [diff] [blame] | 84 | void ShellDelegateImpl::ShowKeyboardOverlay() { |
[email protected] | e6ae78c3 | 2012-05-15 19:14:24 | [diff] [blame] | 85 | } |
86 | |||||
[email protected] | 343dc06 | 2012-05-25 03:16:57 | [diff] [blame^] | 87 | void ShellDelegateImpl::ShowTaskManager() { |
88 | } | ||||
89 | |||||
[email protected] | 24af497 | 2012-05-04 19:42:18 | [diff] [blame] | 90 | content::BrowserContext* ShellDelegateImpl::GetCurrentBrowserContext() { |
91 | return Shell::GetInstance()->browser_context(); | ||||
92 | } | ||||
93 | |||||
[email protected] | ce3d768 | 2012-05-02 23:01:41 | [diff] [blame] | 94 | void ShellDelegateImpl::ToggleSpokenFeedback() { |
95 | } | ||||
96 | |||||
[email protected] | 0039db9 | 2012-05-09 04:11:45 | [diff] [blame] | 97 | app_list::AppListViewDelegate* ShellDelegateImpl::CreateAppListViewDelegate() { |
[email protected] | 262f8bd | 2012-03-23 19:30:27 | [diff] [blame] | 98 | return ash::shell::CreateAppListViewDelegate(); |
99 | } | ||||
100 | |||||
[email protected] | 262f8bd | 2012-03-23 19:30:27 | [diff] [blame] | 101 | void ShellDelegateImpl::StartPartialScreenshot( |
102 | ash::ScreenshotDelegate* screenshot_delegate) { | ||||
103 | ash::PartialScreenshotView::StartPartialScreenshot(screenshot_delegate); | ||||
104 | } | ||||
105 | |||||
106 | ash::LauncherDelegate* ShellDelegateImpl::CreateLauncherDelegate( | ||||
107 | ash::LauncherModel* model) { | ||||
108 | launcher_delegate_ = new LauncherDelegateImpl(watcher_); | ||||
109 | return launcher_delegate_; | ||||
110 | } | ||||
111 | |||||
112 | ash::SystemTrayDelegate* ShellDelegateImpl::CreateSystemTrayDelegate( | ||||
113 | ash::SystemTray* tray) { | ||||
114 | return NULL; | ||||
115 | } | ||||
116 | |||||
117 | ash::UserWallpaperDelegate* ShellDelegateImpl::CreateUserWallpaperDelegate() { | ||||
118 | return NULL; | ||||
119 | } | ||||
120 | |||||
121 | } // namespace shell | ||||
122 | } // namespace ash |