| 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" | |
| 26 #include "chrome/browser/ui/browser.h" | 25 #include "chrome/browser/ui/browser.h" |
| 27 #include "chrome/browser/ui/browser_finder.h" | 26 #include "chrome/browser/ui/browser_finder.h" |
| 28 #include "chrome/browser/ui/browser_list.h" | 27 #include "chrome/browser/ui/browser_list.h" |
| 29 #include "chrome/browser/ui/browser_tabstrip.h" | 28 #include "chrome/browser/ui/browser_tabstrip.h" |
| 30 #include "chrome/browser/ui/browser_window.h" | 29 #include "chrome/browser/ui/browser_window.h" |
| 31 #include "chrome/browser/ui/host_desktop.h" | 30 #include "chrome/browser/ui/host_desktop.h" |
| 32 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 31 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 33 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 32 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
| 34 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 35 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
| 36 | 35 |
| 37 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
| 38 #include "chrome/browser/ui/ash/system_tray_delegate_win.h" | 37 #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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 virtual void TriggerAccessibilityAlert( | 144 virtual void TriggerAccessibilityAlert( |
| 145 ash::AccessibilityAlert alert) OVERRIDE { | 145 ash::AccessibilityAlert alert) OVERRIDE { |
| 146 } | 146 } |
| 147 | 147 |
| 148 virtual ash::AccessibilityAlert GetLastAccessibilityAlert() OVERRIDE { | 148 virtual ash::AccessibilityAlert GetLastAccessibilityAlert() OVERRIDE { |
| 149 return ash::A11Y_ALERT_NONE; | 149 return ash::A11Y_ALERT_NONE; |
| 150 } | 150 } |
| 151 | 151 |
| 152 virtual base::TimeDelta PlayShutdownSound() const OVERRIDE { | 152 base::TimeDelta PlayShutdownSound() const OVERRIDE { |
| 153 return base::TimeDelta(); | 153 return base::TimeDelta(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 DISALLOW_COPY_AND_ASSIGN(EmptyAccessibilityDelegate); | 157 DISALLOW_COPY_AND_ASSIGN(EmptyAccessibilityDelegate); |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 } // namespace | 160 } // namespace |
| 161 | 161 |
| 162 bool ChromeShellDelegate::IsFirstRunAfterBoot() const { | 162 bool ChromeShellDelegate::IsFirstRunAfterBoot() const { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 187 #else | 187 #else |
| 188 return new ash::DefaultSystemTrayDelegate; | 188 return new ash::DefaultSystemTrayDelegate; |
| 189 #endif | 189 #endif |
| 190 } | 190 } |
| 191 | 191 |
| 192 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() { | 192 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() { |
| 193 return new EmptyAccessibilityDelegate; | 193 return new EmptyAccessibilityDelegate; |
| 194 } | 194 } |
| 195 | 195 |
| 196 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() { | 196 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() { |
| 197 return CreateSolidColorUserWallpaperDelegate(); | 197 #if defined(OS_WIN) |
| 198 return ::CreateUserWallpaperDelegate(); |
| 199 #else |
| 200 return NULL; |
| 201 #endif |
| 198 } | 202 } |
| 199 | 203 |
| 200 void ChromeShellDelegate::Observe(int type, | 204 void ChromeShellDelegate::Observe(int type, |
| 201 const content::NotificationSource& source, | 205 const content::NotificationSource& source, |
| 202 const content::NotificationDetails& details) { | 206 const content::NotificationDetails& details) { |
| 203 switch (type) { | 207 switch (type) { |
| 204 case chrome::NOTIFICATION_PROFILE_ADDED: { | 208 case chrome::NOTIFICATION_PROFILE_ADDED: { |
| 205 // Start the error notifier services to show sync/auth notifications. | 209 // Start the error notifier services to show sync/auth notifications. |
| 206 Profile* profile = content::Source<Profile>(source).ptr(); | 210 Profile* profile = content::Source<Profile>(source).ptr(); |
| 207 SigninErrorNotifierFactory::GetForProfile(profile); | 211 SigninErrorNotifierFactory::GetForProfile(profile); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 chrome::NOTIFICATION_PROFILE_ADDED, | 279 chrome::NOTIFICATION_PROFILE_ADDED, |
| 276 content::NotificationService::AllSources()); | 280 content::NotificationService::AllSources()); |
| 277 registrar_.Add(this, | 281 registrar_.Add(this, |
| 278 chrome::NOTIFICATION_ASH_SESSION_STARTED, | 282 chrome::NOTIFICATION_ASH_SESSION_STARTED, |
| 279 content::NotificationService::AllSources()); | 283 content::NotificationService::AllSources()); |
| 280 registrar_.Add(this, | 284 registrar_.Add(this, |
| 281 chrome::NOTIFICATION_ASH_SESSION_ENDED, | 285 chrome::NOTIFICATION_ASH_SESSION_ENDED, |
| 282 content::NotificationService::AllSources()); | 286 content::NotificationService::AllSources()); |
| 283 #endif | 287 #endif |
| 284 } | 288 } |
| OLD | NEW |