OLD | NEW |
| (Empty) |
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 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_CHROME_SHELL_DELEGATE_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_ASH_CHROME_SHELL_DELEGATE_H_ | |
7 | |
8 #include "ash/launcher/launcher_types.h" | |
9 #include "ash/shell_delegate.h" | |
10 #include "base/basictypes.h" | |
11 #include "base/compiler_specific.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "content/public/browser/notification_observer.h" | |
14 #include "content/public/browser/notification_registrar.h" | |
15 | |
16 class WindowPositioner; | |
17 | |
18 namespace views { | |
19 class View; | |
20 } | |
21 | |
22 class ChromeShellDelegate : public ash::ShellDelegate, | |
23 public content::NotificationObserver { | |
24 public: | |
25 ChromeShellDelegate(); | |
26 virtual ~ChromeShellDelegate(); | |
27 | |
28 static ChromeShellDelegate* instance() { return instance_; } | |
29 | |
30 WindowPositioner* window_positioner() { return window_positioner_.get(); } | |
31 | |
32 // ash::ShellDelegate overrides; | |
33 virtual bool IsUserLoggedIn() OVERRIDE; | |
34 virtual bool IsSessionStarted() OVERRIDE; | |
35 virtual void LockScreen() OVERRIDE; | |
36 virtual void UnlockScreen() OVERRIDE; | |
37 virtual bool IsScreenLocked() const OVERRIDE; | |
38 virtual void Shutdown() OVERRIDE; | |
39 virtual void Exit() OVERRIDE; | |
40 virtual void NewTab() OVERRIDE; | |
41 virtual void NewWindow(bool is_incognito) OVERRIDE; | |
42 virtual void OpenFileManager(bool as_dialog) OVERRIDE; | |
43 virtual void OpenCrosh() OVERRIDE; | |
44 virtual void OpenMobileSetup(const std::string& service_path) OVERRIDE; | |
45 virtual void RestoreTab() OVERRIDE; | |
46 virtual bool RotatePaneFocus(ash::Shell::Direction direction) OVERRIDE; | |
47 virtual void ShowKeyboardOverlay() OVERRIDE; | |
48 virtual void ShowTaskManager() OVERRIDE; | |
49 virtual content::BrowserContext* GetCurrentBrowserContext() OVERRIDE; | |
50 virtual void ToggleSpokenFeedback() OVERRIDE; | |
51 virtual bool IsSpokenFeedbackEnabled() const OVERRIDE; | |
52 virtual app_list::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE; | |
53 virtual ash::LauncherDelegate* CreateLauncherDelegate( | |
54 ash::LauncherModel* model) OVERRIDE; | |
55 virtual ash::SystemTrayDelegate* CreateSystemTrayDelegate( | |
56 ash::SystemTray* tray) OVERRIDE; | |
57 virtual ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE; | |
58 virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; | |
59 virtual void OpenFeedbackPage() OVERRIDE; | |
60 virtual void RecordUserMetricsAction(ash::UserMetricsAction action) OVERRIDE; | |
61 | |
62 // content::NotificationObserver override: | |
63 virtual void Observe(int type, | |
64 const content::NotificationSource& source, | |
65 const content::NotificationDetails& details) OVERRIDE; | |
66 | |
67 private: | |
68 static ChromeShellDelegate* instance_; | |
69 | |
70 content::NotificationRegistrar registrar_; | |
71 | |
72 scoped_ptr<WindowPositioner> window_positioner_; | |
73 | |
74 base::WeakPtrFactory<ChromeShellDelegate> weak_factory_; | |
75 | |
76 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate); | |
77 }; | |
78 | |
79 #endif // CHROME_BROWSER_UI_VIEWS_ASH_CHROME_SHELL_DELEGATE_H_ | |
OLD | NEW |