| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/accessibility_delegate.h" | 9 #include "ash/accessibility_delegate.h" |
| 10 #include "ash/magnifier/magnifier_constants.h" | 10 #include "ash/magnifier/magnifier_constants.h" |
| 11 #include "ash/media_delegate.h" | 11 #include "ash/media_delegate.h" |
| 12 #include "ash/system/tray/default_system_tray_delegate.h" | 12 #include "ash/system/tray/default_system_tray_delegate.h" |
| 13 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "chrome/browser/accessibility/accessibility_events.h" | 15 #include "chrome/browser/accessibility/accessibility_events.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
| 18 #include "chrome/browser/prefs/session_startup_pref.h" | 18 #include "chrome/browser/prefs/session_startup_pref.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
| 21 #include "chrome/browser/signin/signin_error_notifier_factory_ash.h" | 21 #include "chrome/browser/signin/signin_error_notifier_factory_ash.h" |
| 22 #include "chrome/browser/sync/sync_error_notifier_factory_ash.h" | 22 #include "chrome/browser/sync/sync_error_notifier_factory_ash.h" |
| 23 #include "chrome/browser/ui/ash/chrome_new_window_delegate.h" | 23 #include "chrome/browser/ui/ash/chrome_new_window_delegate.h" |
| 24 #include "chrome/browser/ui/ash/session_state_delegate_views.h" | 24 #include "chrome/browser/ui/ash/session_state_delegate_views.h" |
| 25 #include "chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.h" |
| 25 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 26 #include "chrome/browser/ui/browser_finder.h" | 27 #include "chrome/browser/ui/browser_finder.h" |
| 27 #include "chrome/browser/ui/browser_list.h" | 28 #include "chrome/browser/ui/browser_list.h" |
| 28 #include "chrome/browser/ui/browser_tabstrip.h" | 29 #include "chrome/browser/ui/browser_tabstrip.h" |
| 29 #include "chrome/browser/ui/browser_window.h" | 30 #include "chrome/browser/ui/browser_window.h" |
| 30 #include "chrome/browser/ui/host_desktop.h" | 31 #include "chrome/browser/ui/host_desktop.h" |
| 31 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 32 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 32 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 33 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
| 33 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
| 34 #include "content/public/browser/notification_service.h" | 35 #include "content/public/browser/notification_service.h" |
| 35 | 36 |
| 36 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| 37 #include "chrome/browser/ui/ash/system_tray_delegate_win.h" | 38 #include "chrome/browser/ui/ash/system_tray_delegate_win.h" |
| 38 #include "chrome/browser/ui/ash/user_wallpaper_delegate_win.h" | |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 class NewWindowDelegateImpl : public ChromeNewWindowDelegate { | 43 class NewWindowDelegateImpl : public ChromeNewWindowDelegate { |
| 44 public: | 44 public: |
| 45 NewWindowDelegateImpl() {} | 45 NewWindowDelegateImpl() {} |
| 46 virtual ~NewWindowDelegateImpl() {} | 46 virtual ~NewWindowDelegateImpl() {} |
| 47 | 47 |
| 48 // Overridden from ash::NewWindowDelegate: | 48 // Overridden from ash::NewWindowDelegate: |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 | 139 |
| 140 virtual void TriggerAccessibilityAlert( | 140 virtual void TriggerAccessibilityAlert( |
| 141 ash::AccessibilityAlert alert) OVERRIDE { | 141 ash::AccessibilityAlert alert) OVERRIDE { |
| 142 } | 142 } |
| 143 | 143 |
| 144 virtual ash::AccessibilityAlert GetLastAccessibilityAlert() OVERRIDE { | 144 virtual ash::AccessibilityAlert GetLastAccessibilityAlert() OVERRIDE { |
| 145 return ash::A11Y_ALERT_NONE; | 145 return ash::A11Y_ALERT_NONE; |
| 146 } | 146 } |
| 147 | 147 |
| 148 base::TimeDelta PlayShutdownSound() const OVERRIDE { | 148 virtual base::TimeDelta PlayShutdownSound() const OVERRIDE { |
| 149 return base::TimeDelta(); | 149 return base::TimeDelta(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 private: | 152 private: |
| 153 DISALLOW_COPY_AND_ASSIGN(EmptyAccessibilityDelegate); | 153 DISALLOW_COPY_AND_ASSIGN(EmptyAccessibilityDelegate); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 } // namespace | 156 } // namespace |
| 157 | 157 |
| 158 bool ChromeShellDelegate::IsFirstRunAfterBoot() const { | 158 bool ChromeShellDelegate::IsFirstRunAfterBoot() const { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 183 #else | 183 #else |
| 184 return new ash::DefaultSystemTrayDelegate; | 184 return new ash::DefaultSystemTrayDelegate; |
| 185 #endif | 185 #endif |
| 186 } | 186 } |
| 187 | 187 |
| 188 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() { | 188 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() { |
| 189 return new EmptyAccessibilityDelegate; | 189 return new EmptyAccessibilityDelegate; |
| 190 } | 190 } |
| 191 | 191 |
| 192 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() { | 192 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() { |
| 193 #if defined(OS_WIN) | 193 return CreateSolidColorUserWallpaperDelegate(); |
| 194 return ::CreateUserWallpaperDelegate(); | |
| 195 #else | |
| 196 return NULL; | |
| 197 #endif | |
| 198 } | 194 } |
| 199 | 195 |
| 200 void ChromeShellDelegate::Observe(int type, | 196 void ChromeShellDelegate::Observe(int type, |
| 201 const content::NotificationSource& source, | 197 const content::NotificationSource& source, |
| 202 const content::NotificationDetails& details) { | 198 const content::NotificationDetails& details) { |
| 203 switch (type) { | 199 switch (type) { |
| 204 case chrome::NOTIFICATION_PROFILE_ADDED: { | 200 case chrome::NOTIFICATION_PROFILE_ADDED: { |
| 205 // Start the error notifier services to show sync/auth notifications. | 201 // Start the error notifier services to show sync/auth notifications. |
| 206 Profile* profile = content::Source<Profile>(source).ptr(); | 202 Profile* profile = content::Source<Profile>(source).ptr(); |
| 207 SigninErrorNotifierFactory::GetForProfile(profile); | 203 SigninErrorNotifierFactory::GetForProfile(profile); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 chrome::NOTIFICATION_PROFILE_ADDED, | 271 chrome::NOTIFICATION_PROFILE_ADDED, |
| 276 content::NotificationService::AllSources()); | 272 content::NotificationService::AllSources()); |
| 277 registrar_.Add(this, | 273 registrar_.Add(this, |
| 278 chrome::NOTIFICATION_ASH_SESSION_STARTED, | 274 chrome::NOTIFICATION_ASH_SESSION_STARTED, |
| 279 content::NotificationService::AllSources()); | 275 content::NotificationService::AllSources()); |
| 280 registrar_.Add(this, | 276 registrar_.Add(this, |
| 281 chrome::NOTIFICATION_ASH_SESSION_ENDED, | 277 chrome::NOTIFICATION_ASH_SESSION_ENDED, |
| 282 content::NotificationService::AllSources()); | 278 content::NotificationService::AllSources()); |
| 283 #endif | 279 #endif |
| 284 } | 280 } |
| OLD | NEW |