| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 6 | 6 |
| 7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
| 8 #include "ash/magnifier/magnifier_constants.h" | 8 #include "ash/magnifier/magnifier_constants.h" |
| 9 #include "ash/media_delegate.h" |
| 9 #include "ash/system/tray/default_system_tray_delegate.h" | 10 #include "ash/system/tray/default_system_tray_delegate.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/browser/prefs/session_startup_pref.h" | 13 #include "chrome/browser/prefs/session_startup_pref.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/ui/ash/caps_lock_delegate_views.h" | 15 #include "chrome/browser/ui/ash/caps_lock_delegate_views.h" |
| 15 #include "chrome/browser/ui/ash/chrome_new_window_delegate.h" | 16 #include "chrome/browser/ui/ash/chrome_new_window_delegate.h" |
| 16 #include "chrome/browser/ui/ash/session_state_delegate_views.h" | 17 #include "chrome/browser/ui/ash/session_state_delegate_views.h" |
| 17 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 37 | 38 |
| 38 // Overridden from ash::NewWindowDelegate: | 39 // Overridden from ash::NewWindowDelegate: |
| 39 virtual void OpenFileManager() OVERRIDE {} | 40 virtual void OpenFileManager() OVERRIDE {} |
| 40 virtual void OpenCrosh() OVERRIDE {} | 41 virtual void OpenCrosh() OVERRIDE {} |
| 41 virtual void ShowKeyboardOverlay() OVERRIDE {} | 42 virtual void ShowKeyboardOverlay() OVERRIDE {} |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(NewWindowDelegateImpl); | 45 DISALLOW_COPY_AND_ASSIGN(NewWindowDelegateImpl); |
| 45 }; | 46 }; |
| 46 | 47 |
| 48 class MediaDelegateImpl : public ash::MediaDelegate { |
| 49 public: |
| 50 MediaDelegateImpl() {} |
| 51 virtual ~MediaDelegateImpl() {} |
| 52 virtual void HandleMediaNextTrack() OVERRIDE {} |
| 53 virtual void HandleMediaPlayPause() OVERRIDE {} |
| 54 virtual void HandleMediaPrevTrack() OVERRIDE {} |
| 55 |
| 56 private: |
| 57 DISALLOW_COPY_AND_ASSIGN(MediaDelegateImpl); |
| 58 }; |
| 59 |
| 47 class EmptyAccessibilityDelegate : public ash::AccessibilityDelegate { | 60 class EmptyAccessibilityDelegate : public ash::AccessibilityDelegate { |
| 48 public: | 61 public: |
| 49 EmptyAccessibilityDelegate() {} | 62 EmptyAccessibilityDelegate() {} |
| 50 virtual ~EmptyAccessibilityDelegate() {} | 63 virtual ~EmptyAccessibilityDelegate() {} |
| 51 | 64 |
| 52 virtual void ToggleHighContrast() OVERRIDE { | 65 virtual void ToggleHighContrast() OVERRIDE { |
| 53 } | 66 } |
| 54 | 67 |
| 55 virtual bool IsHighContrastEnabled() const OVERRIDE { | 68 virtual bool IsHighContrastEnabled() const OVERRIDE { |
| 56 return false; | 69 return false; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 void ChromeShellDelegate::PreInit() { | 132 void ChromeShellDelegate::PreInit() { |
| 120 } | 133 } |
| 121 | 134 |
| 122 void ChromeShellDelegate::Shutdown() { | 135 void ChromeShellDelegate::Shutdown() { |
| 123 } | 136 } |
| 124 | 137 |
| 125 ash::NewWindowDelegate* ChromeShellDelegate::CreateNewWindowDelegate() { | 138 ash::NewWindowDelegate* ChromeShellDelegate::CreateNewWindowDelegate() { |
| 126 return new NewWindowDelegateImpl; | 139 return new NewWindowDelegateImpl; |
| 127 } | 140 } |
| 128 | 141 |
| 142 ash::MediaDelegate* ChromeShellDelegate::CreateMediaDelegate() { |
| 143 return new MediaDelegateImpl; |
| 144 } |
| 145 |
| 129 ash::CapsLockDelegate* ChromeShellDelegate::CreateCapsLockDelegate() { | 146 ash::CapsLockDelegate* ChromeShellDelegate::CreateCapsLockDelegate() { |
| 130 return new CapsLockDelegate(); | 147 return new CapsLockDelegate(); |
| 131 } | 148 } |
| 132 | 149 |
| 133 ash::SessionStateDelegate* ChromeShellDelegate::CreateSessionStateDelegate() { | 150 ash::SessionStateDelegate* ChromeShellDelegate::CreateSessionStateDelegate() { |
| 134 return new SessionStateDelegate; | 151 return new SessionStateDelegate; |
| 135 } | 152 } |
| 136 | 153 |
| 137 ash::SystemTrayDelegate* ChromeShellDelegate::CreateSystemTrayDelegate() { | 154 ash::SystemTrayDelegate* ChromeShellDelegate::CreateSystemTrayDelegate() { |
| 138 #if defined(OS_WIN) | 155 #if defined(OS_WIN) |
| 139 return CreateWindowsSystemTrayDelegate(); | 156 return CreateWindowsSystemTrayDelegate(); |
| 140 #else | 157 #else |
| 141 return new ash::DefaultSystemTrayDelegate; | 158 return new ash::DefaultSystemTrayDelegate; |
| 142 #endif | 159 #endif |
| 143 } | 160 } |
| 144 | 161 |
| 145 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() { | 162 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() { |
| 146 return new EmptyAccessibilityDelegate; | 163 return new EmptyAccessibilityDelegate; |
| 147 } | 164 } |
| 148 | 165 |
| 149 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() { | 166 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() { |
| 150 #if defined(OS_WIN) | 167 #if defined(OS_WIN) |
| 151 return ::CreateUserWallpaperDelegate(); | 168 return ::CreateUserWallpaperDelegate(); |
| 152 #else | 169 #else |
| 153 return NULL; | 170 return NULL; |
| 154 #endif | 171 #endif |
| 155 } | 172 } |
| 156 | 173 |
| 157 void ChromeShellDelegate::HandleMediaNextTrack() { | |
| 158 } | |
| 159 | |
| 160 void ChromeShellDelegate::HandleMediaPlayPause() { | |
| 161 } | |
| 162 | |
| 163 void ChromeShellDelegate::HandleMediaPrevTrack() { | |
| 164 } | |
| 165 | |
| 166 void ChromeShellDelegate::Observe(int type, | 174 void ChromeShellDelegate::Observe(int type, |
| 167 const content::NotificationSource& source, | 175 const content::NotificationSource& source, |
| 168 const content::NotificationDetails& details) { | 176 const content::NotificationDetails& details) { |
| 169 switch (type) { | 177 switch (type) { |
| 170 case chrome::NOTIFICATION_ASH_SESSION_STARTED: { | 178 case chrome::NOTIFICATION_ASH_SESSION_STARTED: { |
| 171 // If we are launched to service a windows 8 search request then let the | 179 // If we are launched to service a windows 8 search request then let the |
| 172 // IPC which carries the search string create the browser and initiate | 180 // IPC which carries the search string create the browser and initiate |
| 173 // the navigation. | 181 // the navigation. |
| 174 if (CommandLine::ForCurrentProcess()->HasSwitch( | 182 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 175 switches::kWindows8Search)) | 183 switches::kWindows8Search)) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 void ChromeShellDelegate::PlatformInit() { | 219 void ChromeShellDelegate::PlatformInit() { |
| 212 #if defined(OS_WIN) | 220 #if defined(OS_WIN) |
| 213 registrar_.Add(this, | 221 registrar_.Add(this, |
| 214 chrome::NOTIFICATION_ASH_SESSION_STARTED, | 222 chrome::NOTIFICATION_ASH_SESSION_STARTED, |
| 215 content::NotificationService::AllSources()); | 223 content::NotificationService::AllSources()); |
| 216 registrar_.Add(this, | 224 registrar_.Add(this, |
| 217 chrome::NOTIFICATION_ASH_SESSION_ENDED, | 225 chrome::NOTIFICATION_ASH_SESSION_ENDED, |
| 218 content::NotificationService::AllSources()); | 226 content::NotificationService::AllSources()); |
| 219 #endif | 227 #endif |
| 220 } | 228 } |
| OLD | NEW |