OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_CHROME_SHELL_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_CHROME_SHELL_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_ASH_CHROME_SHELL_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ASH_CHROME_SHELL_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/launcher/launcher_types.h" | 9 #include "ash/launcher/launcher_types.h" |
10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/prefs/pref_change_registrar.h" | |
14 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
16 | 17 |
18 class PrefService; | |
17 class WindowPositioner; | 19 class WindowPositioner; |
18 | 20 |
19 namespace views { | 21 namespace views { |
20 class View; | 22 class View; |
21 } | 23 } |
22 | 24 |
23 class ChromeShellDelegate : public ash::ShellDelegate, | 25 class ChromeShellDelegate : public ash::ShellDelegate, |
24 public content::NotificationObserver { | 26 public content::NotificationObserver { |
25 public: | 27 public: |
26 ChromeShellDelegate(); | 28 ChromeShellDelegate(); |
27 virtual ~ChromeShellDelegate(); | 29 virtual ~ChromeShellDelegate(); |
28 | 30 |
29 static ChromeShellDelegate* instance() { return instance_; } | 31 static ChromeShellDelegate* instance() { return instance_; } |
30 | 32 |
31 WindowPositioner* window_positioner() { return window_positioner_.get(); } | 33 WindowPositioner* window_positioner() { return window_positioner_.get(); } |
32 | 34 |
35 #if defined(OS_CHROMEOS) | |
36 // This is used for registering both local state and user prefs. | |
Mattias Nissler (ping if slow)
2012/07/09 09:30:12
That comment doesn't seem very helpful as the func
qfel
2012/07/11 12:34:49
At the beginning there was one method that was sup
| |
37 static void RegisterLocalPrefs(PrefService* service); | |
38 static void RegisterUserPrefs(PrefService* service); | |
39 void UpdateScreenshotDelegate(); | |
40 #endif | |
41 | |
33 // ash::ShellDelegate overrides; | 42 // ash::ShellDelegate overrides; |
34 virtual bool IsUserLoggedIn() OVERRIDE; | 43 virtual bool IsUserLoggedIn() OVERRIDE; |
35 virtual void LockScreen() OVERRIDE; | 44 virtual void LockScreen() OVERRIDE; |
36 virtual void UnlockScreen() OVERRIDE; | 45 virtual void UnlockScreen() OVERRIDE; |
37 virtual bool IsScreenLocked() const OVERRIDE; | 46 virtual bool IsScreenLocked() const OVERRIDE; |
38 virtual void Shutdown() OVERRIDE; | 47 virtual void Shutdown() OVERRIDE; |
39 virtual void Exit() OVERRIDE; | 48 virtual void Exit() OVERRIDE; |
40 virtual void NewTab() OVERRIDE; | 49 virtual void NewTab() OVERRIDE; |
41 virtual void NewWindow(bool is_incognito) OVERRIDE; | 50 virtual void NewWindow(bool is_incognito) OVERRIDE; |
42 virtual void OpenFileManager(bool as_dialog) OVERRIDE; | 51 virtual void OpenFileManager(bool as_dialog) OVERRIDE; |
(...skipping 17 matching lines...) Expand all Loading... | |
60 virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; | 69 virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; |
61 | 70 |
62 // content::NotificationObserver override: | 71 // content::NotificationObserver override: |
63 virtual void Observe(int type, | 72 virtual void Observe(int type, |
64 const content::NotificationSource& source, | 73 const content::NotificationSource& source, |
65 const content::NotificationDetails& details) OVERRIDE; | 74 const content::NotificationDetails& details) OVERRIDE; |
66 | 75 |
67 private: | 76 private: |
68 static ChromeShellDelegate* instance_; | 77 static ChromeShellDelegate* instance_; |
69 | 78 |
79 #if defined(OS_CHROMEOS) | |
70 content::NotificationRegistrar registrar_; | 80 content::NotificationRegistrar registrar_; |
81 PrefChangeRegistrar pref_registrar_; | |
82 #endif | |
71 | 83 |
72 scoped_ptr<WindowPositioner> window_positioner_; | 84 scoped_ptr<WindowPositioner> window_positioner_; |
73 | 85 |
74 base::WeakPtrFactory<ChromeShellDelegate> weak_factory_; | 86 base::WeakPtrFactory<ChromeShellDelegate> weak_factory_; |
75 | 87 |
76 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate); | 88 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate); |
77 }; | 89 }; |
78 | 90 |
79 #endif // CHROME_BROWSER_UI_VIEWS_ASH_CHROME_SHELL_DELEGATE_H_ | 91 #endif // CHROME_BROWSER_UI_VIEWS_ASH_CHROME_SHELL_DELEGATE_H_ |
OLD | NEW |