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 #include "ash/shell/shell_delegate_impl.h" | 5 #include "ash/shell/shell_delegate_impl.h" |
6 | 6 |
7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
8 #include "ash/default_accessibility_delegate.h" | 8 #include "ash/default_accessibility_delegate.h" |
9 #include "ash/default_user_wallpaper_delegate.h" | 9 #include "ash/default_user_wallpaper_delegate.h" |
10 #include "ash/gpu_support_stub.h" | 10 #include "ash/gpu_support_stub.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace ash { | 29 namespace ash { |
30 namespace shell { | 30 namespace shell { |
31 namespace { | 31 namespace { |
32 | 32 |
33 class NewWindowDelegateImpl : public NewWindowDelegate { | 33 class NewWindowDelegateImpl : public NewWindowDelegate { |
34 public: | 34 public: |
35 NewWindowDelegateImpl() {} | 35 NewWindowDelegateImpl() {} |
36 virtual ~NewWindowDelegateImpl() {} | 36 virtual ~NewWindowDelegateImpl() {} |
37 | 37 |
38 // NewWindowDelegate: | 38 // NewWindowDelegate: |
39 virtual void NewTab() OVERRIDE {} | 39 virtual void NewTab() override {} |
40 virtual void NewWindow(bool incognito) OVERRIDE { | 40 virtual void NewWindow(bool incognito) override { |
41 ash::shell::ToplevelWindow::CreateParams create_params; | 41 ash::shell::ToplevelWindow::CreateParams create_params; |
42 create_params.can_resize = true; | 42 create_params.can_resize = true; |
43 create_params.can_maximize = true; | 43 create_params.can_maximize = true; |
44 ash::shell::ToplevelWindow::CreateToplevelWindow(create_params); | 44 ash::shell::ToplevelWindow::CreateToplevelWindow(create_params); |
45 } | 45 } |
46 virtual void OpenFileManager() OVERRIDE {} | 46 virtual void OpenFileManager() override {} |
47 virtual void OpenCrosh() OVERRIDE {} | 47 virtual void OpenCrosh() override {} |
48 virtual void RestoreTab() OVERRIDE {} | 48 virtual void RestoreTab() override {} |
49 virtual void ShowKeyboardOverlay() OVERRIDE {} | 49 virtual void ShowKeyboardOverlay() override {} |
50 virtual void ShowTaskManager() OVERRIDE {} | 50 virtual void ShowTaskManager() override {} |
51 virtual void OpenFeedbackPage() OVERRIDE {} | 51 virtual void OpenFeedbackPage() override {} |
52 | 52 |
53 private: | 53 private: |
54 DISALLOW_COPY_AND_ASSIGN(NewWindowDelegateImpl); | 54 DISALLOW_COPY_AND_ASSIGN(NewWindowDelegateImpl); |
55 }; | 55 }; |
56 | 56 |
57 class MediaDelegateImpl : public MediaDelegate { | 57 class MediaDelegateImpl : public MediaDelegate { |
58 public: | 58 public: |
59 MediaDelegateImpl() {} | 59 MediaDelegateImpl() {} |
60 virtual ~MediaDelegateImpl() {} | 60 virtual ~MediaDelegateImpl() {} |
61 | 61 |
62 // MediaDelegate: | 62 // MediaDelegate: |
63 virtual void HandleMediaNextTrack() OVERRIDE {} | 63 virtual void HandleMediaNextTrack() override {} |
64 virtual void HandleMediaPlayPause() OVERRIDE {} | 64 virtual void HandleMediaPlayPause() override {} |
65 virtual void HandleMediaPrevTrack() OVERRIDE {} | 65 virtual void HandleMediaPrevTrack() override {} |
66 virtual MediaCaptureState GetMediaCaptureState( | 66 virtual MediaCaptureState GetMediaCaptureState( |
67 content::BrowserContext* context) OVERRIDE { | 67 content::BrowserContext* context) override { |
68 return MEDIA_CAPTURE_VIDEO; | 68 return MEDIA_CAPTURE_VIDEO; |
69 } | 69 } |
70 | 70 |
71 private: | 71 private: |
72 DISALLOW_COPY_AND_ASSIGN(MediaDelegateImpl); | 72 DISALLOW_COPY_AND_ASSIGN(MediaDelegateImpl); |
73 }; | 73 }; |
74 | 74 |
75 class SessionStateDelegateImpl : public SessionStateDelegate { | 75 class SessionStateDelegateImpl : public SessionStateDelegate { |
76 public: | 76 public: |
77 SessionStateDelegateImpl() | 77 SessionStateDelegateImpl() |
78 : screen_locked_(false), user_info_(new user_manager::UserInfoImpl()) {} | 78 : screen_locked_(false), user_info_(new user_manager::UserInfoImpl()) {} |
79 | 79 |
80 virtual ~SessionStateDelegateImpl() {} | 80 virtual ~SessionStateDelegateImpl() {} |
81 | 81 |
82 // SessionStateDelegate: | 82 // SessionStateDelegate: |
83 virtual content::BrowserContext* GetBrowserContextByIndex( | 83 virtual content::BrowserContext* GetBrowserContextByIndex( |
84 MultiProfileIndex index) OVERRIDE { | 84 MultiProfileIndex index) override { |
85 return Shell::GetInstance()->delegate()->GetActiveBrowserContext(); | 85 return Shell::GetInstance()->delegate()->GetActiveBrowserContext(); |
86 } | 86 } |
87 virtual content::BrowserContext* GetBrowserContextForWindow( | 87 virtual content::BrowserContext* GetBrowserContextForWindow( |
88 aura::Window* window) OVERRIDE { | 88 aura::Window* window) override { |
89 return Shell::GetInstance()->delegate()->GetActiveBrowserContext(); | 89 return Shell::GetInstance()->delegate()->GetActiveBrowserContext(); |
90 } | 90 } |
91 virtual int GetMaximumNumberOfLoggedInUsers() const OVERRIDE { return 3; } | 91 virtual int GetMaximumNumberOfLoggedInUsers() const override { return 3; } |
92 virtual int NumberOfLoggedInUsers() const OVERRIDE { | 92 virtual int NumberOfLoggedInUsers() const override { |
93 // ash_shell has 2 users. | 93 // ash_shell has 2 users. |
94 return 2; | 94 return 2; |
95 } | 95 } |
96 virtual bool IsActiveUserSessionStarted() const OVERRIDE { return true; } | 96 virtual bool IsActiveUserSessionStarted() const override { return true; } |
97 virtual bool CanLockScreen() const OVERRIDE { return true; } | 97 virtual bool CanLockScreen() const override { return true; } |
98 virtual bool IsScreenLocked() const OVERRIDE { return screen_locked_; } | 98 virtual bool IsScreenLocked() const override { return screen_locked_; } |
99 virtual bool ShouldLockScreenBeforeSuspending() const OVERRIDE { | 99 virtual bool ShouldLockScreenBeforeSuspending() const override { |
100 return false; | 100 return false; |
101 } | 101 } |
102 virtual void LockScreen() OVERRIDE { | 102 virtual void LockScreen() override { |
103 shell::CreateLockScreen(); | 103 shell::CreateLockScreen(); |
104 screen_locked_ = true; | 104 screen_locked_ = true; |
105 Shell::GetInstance()->UpdateShelfVisibility(); | 105 Shell::GetInstance()->UpdateShelfVisibility(); |
106 } | 106 } |
107 virtual void UnlockScreen() OVERRIDE { | 107 virtual void UnlockScreen() override { |
108 screen_locked_ = false; | 108 screen_locked_ = false; |
109 Shell::GetInstance()->UpdateShelfVisibility(); | 109 Shell::GetInstance()->UpdateShelfVisibility(); |
110 } | 110 } |
111 virtual bool IsUserSessionBlocked() const OVERRIDE { | 111 virtual bool IsUserSessionBlocked() const override { |
112 return !IsActiveUserSessionStarted() || IsScreenLocked(); | 112 return !IsActiveUserSessionStarted() || IsScreenLocked(); |
113 } | 113 } |
114 virtual SessionState GetSessionState() const OVERRIDE { | 114 virtual SessionState GetSessionState() const override { |
115 // Assume that if session is not active we're at login. | 115 // Assume that if session is not active we're at login. |
116 return IsActiveUserSessionStarted() ? SESSION_STATE_ACTIVE | 116 return IsActiveUserSessionStarted() ? SESSION_STATE_ACTIVE |
117 : SESSION_STATE_LOGIN_PRIMARY; | 117 : SESSION_STATE_LOGIN_PRIMARY; |
118 } | 118 } |
119 virtual const user_manager::UserInfo* GetUserInfo( | 119 virtual const user_manager::UserInfo* GetUserInfo( |
120 MultiProfileIndex index) const OVERRIDE { | 120 MultiProfileIndex index) const override { |
121 return user_info_.get(); | 121 return user_info_.get(); |
122 } | 122 } |
123 virtual const user_manager::UserInfo* GetUserInfo( | 123 virtual const user_manager::UserInfo* GetUserInfo( |
124 content::BrowserContext* context) const OVERRIDE { | 124 content::BrowserContext* context) const override { |
125 return user_info_.get(); | 125 return user_info_.get(); |
126 } | 126 } |
127 virtual bool ShouldShowAvatar(aura::Window* window) const OVERRIDE { | 127 virtual bool ShouldShowAvatar(aura::Window* window) const override { |
128 return !user_info_->GetImage().isNull(); | 128 return !user_info_->GetImage().isNull(); |
129 } | 129 } |
130 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE {} | 130 virtual void SwitchActiveUser(const std::string& user_id) override {} |
131 virtual void CycleActiveUser(CycleUser cycle_user) OVERRIDE {} | 131 virtual void CycleActiveUser(CycleUser cycle_user) override {} |
132 virtual bool IsMultiProfileAllowedByPrimaryUserPolicy() const OVERRIDE { | 132 virtual bool IsMultiProfileAllowedByPrimaryUserPolicy() const override { |
133 return true; | 133 return true; |
134 } | 134 } |
135 virtual void AddSessionStateObserver( | 135 virtual void AddSessionStateObserver( |
136 ash::SessionStateObserver* observer) OVERRIDE {} | 136 ash::SessionStateObserver* observer) override {} |
137 virtual void RemoveSessionStateObserver( | 137 virtual void RemoveSessionStateObserver( |
138 ash::SessionStateObserver* observer) OVERRIDE {} | 138 ash::SessionStateObserver* observer) override {} |
139 | 139 |
140 private: | 140 private: |
141 bool screen_locked_; | 141 bool screen_locked_; |
142 | 142 |
143 // A pseudo user info. | 143 // A pseudo user info. |
144 scoped_ptr<user_manager::UserInfo> user_info_; | 144 scoped_ptr<user_manager::UserInfo> user_info_; |
145 | 145 |
146 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateImpl); | 146 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateImpl); |
147 }; | 147 }; |
148 | 148 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // Real GPU support depends on src/content, so just use a stub. | 259 // Real GPU support depends on src/content, so just use a stub. |
260 return new GPUSupportStub; | 260 return new GPUSupportStub; |
261 } | 261 } |
262 | 262 |
263 base::string16 ShellDelegateImpl::GetProductName() const { | 263 base::string16 ShellDelegateImpl::GetProductName() const { |
264 return base::string16(); | 264 return base::string16(); |
265 } | 265 } |
266 | 266 |
267 } // namespace shell | 267 } // namespace shell |
268 } // namespace ash | 268 } // namespace ash |
OLD | NEW |