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 "base/command_line.h" | |
8 #include "ash/magnifier/magnifier_constants.h" | 7 #include "ash/magnifier/magnifier_constants.h" |
9 #include "ash/system/tray/default_system_tray_delegate.h" | 8 #include "ash/system/tray/default_system_tray_delegate.h" |
| 9 #include "base/command_line.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
11 #include "chrome/browser/prefs/session_startup_pref.h" | 11 #include "chrome/browser/prefs/session_startup_pref.h" |
12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
13 #include "chrome/browser/ui/ash/caps_lock_delegate_views.h" | 13 #include "chrome/browser/ui/ash/caps_lock_delegate_views.h" |
14 #include "chrome/browser/ui/ash/session_state_delegate_views.h" | 14 #include "chrome/browser/ui/ash/session_state_delegate_views.h" |
| 15 #include "chrome/browser/ui/ash/solid_color_user_wallpaper_delegate.h" |
15 #include "chrome/browser/ui/ash/window_positioner.h" | 16 #include "chrome/browser/ui/ash/window_positioner.h" |
16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/browser_list.h" | 18 #include "chrome/browser/ui/browser_list.h" |
18 #include "chrome/browser/ui/browser_tabstrip.h" | 19 #include "chrome/browser/ui/browser_tabstrip.h" |
19 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
20 #include "chrome/browser/ui/host_desktop.h" | 21 #include "chrome/browser/ui/host_desktop.h" |
21 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 22 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
22 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
23 #include "content/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
24 | 25 |
25 #if defined(OS_WIN) | |
26 #include "chrome/browser/ui/ash/user_wallpaper_delegate_win.h" | |
27 #endif | |
28 | |
29 bool ChromeShellDelegate::IsFirstRunAfterBoot() const { | 26 bool ChromeShellDelegate::IsFirstRunAfterBoot() const { |
30 return false; | 27 return false; |
31 } | 28 } |
32 | 29 |
33 void ChromeShellDelegate::PreInit() { | 30 void ChromeShellDelegate::PreInit() { |
34 } | 31 } |
35 | 32 |
36 void ChromeShellDelegate::Shutdown() { | 33 void ChromeShellDelegate::Shutdown() { |
37 } | 34 } |
38 | 35 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 99 |
103 void ChromeShellDelegate::SilenceSpokenFeedback() const { | 100 void ChromeShellDelegate::SilenceSpokenFeedback() const { |
104 } | 101 } |
105 | 102 |
106 ash::SystemTrayDelegate* ChromeShellDelegate::CreateSystemTrayDelegate() { | 103 ash::SystemTrayDelegate* ChromeShellDelegate::CreateSystemTrayDelegate() { |
107 // TODO(sky): need to subclass and override Shutdown() in a meaningful way. | 104 // TODO(sky): need to subclass and override Shutdown() in a meaningful way. |
108 return new ash::DefaultSystemTrayDelegate; | 105 return new ash::DefaultSystemTrayDelegate; |
109 } | 106 } |
110 | 107 |
111 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() { | 108 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() { |
112 #if defined(OS_WIN) | 109 return CreateSolidColorUserWallpaperDelegate(); |
113 return ::CreateUserWallpaperDelegate(); | |
114 #else | |
115 return NULL; | |
116 #endif | |
117 } | 110 } |
118 | 111 |
119 void ChromeShellDelegate::HandleMediaNextTrack() { | 112 void ChromeShellDelegate::HandleMediaNextTrack() { |
120 } | 113 } |
121 | 114 |
122 void ChromeShellDelegate::HandleMediaPlayPause() { | 115 void ChromeShellDelegate::HandleMediaPlayPause() { |
123 } | 116 } |
124 | 117 |
125 void ChromeShellDelegate::HandleMediaPrevTrack() { | 118 void ChromeShellDelegate::HandleMediaPrevTrack() { |
126 } | 119 } |
127 | 120 |
128 void ChromeShellDelegate::Observe(int type, | 121 void ChromeShellDelegate::Observe(int type, |
129 const content::NotificationSource& source, | 122 const content::NotificationSource& source, |
130 const content::NotificationDetails& details) { | 123 const content::NotificationDetails& details) { |
131 switch (type) { | 124 switch (type) { |
132 case chrome::NOTIFICATION_ASH_SESSION_STARTED: { | 125 case chrome::NOTIFICATION_ASH_SESSION_STARTED: { |
| 126 #if defined(OS_WIN) |
133 // If we are launched to service a windows 8 search request then let the | 127 // If we are launched to service a windows 8 search request then let the |
134 // IPC which carries the search string create the browser and initiate | 128 // IPC which carries the search string create the browser and initiate |
135 // the navigation. | 129 // the navigation. |
136 if (CommandLine::ForCurrentProcess()->HasSwitch( | 130 if (CommandLine::ForCurrentProcess()->HasSwitch( |
137 switches::kWindows8Search)) | 131 switches::kWindows8Search)) |
138 break; | 132 break; |
| 133 #endif |
139 // If Chrome ASH is launched when no browser is open in the desktop, | 134 // If Chrome ASH is launched when no browser is open in the desktop, |
140 // we should execute the startup code. | 135 // we should execute the startup code. |
141 // If there are browsers open in the desktop, we create a browser window | 136 // If there are browsers open in the desktop, we create a browser window |
142 // and open a new tab page, if session restore is not on. | 137 // and open a new tab page, if session restore is not on. |
143 BrowserList* desktop_list = BrowserList::GetInstance( | 138 BrowserList* desktop_list = BrowserList::GetInstance( |
144 chrome::HOST_DESKTOP_TYPE_NATIVE); | 139 chrome::HOST_DESKTOP_TYPE_NATIVE); |
145 if (desktop_list->empty()) { | 140 if (desktop_list->empty()) { |
146 // We pass a dummy command line here, because the browser is launched in | 141 // We pass a dummy command line here, because the browser is launched in |
147 // silent-mode by the metro viewer process, which causes the | 142 // silent-mode by the metro viewer process, which causes the |
148 // StartupBrowserCreatorImpl class to not create any browsers which is | 143 // StartupBrowserCreatorImpl class to not create any browsers which is |
(...skipping 24 matching lines...) Expand all Loading... |
173 void ChromeShellDelegate::PlatformInit() { | 168 void ChromeShellDelegate::PlatformInit() { |
174 #if defined(OS_WIN) | 169 #if defined(OS_WIN) |
175 registrar_.Add(this, | 170 registrar_.Add(this, |
176 chrome::NOTIFICATION_ASH_SESSION_STARTED, | 171 chrome::NOTIFICATION_ASH_SESSION_STARTED, |
177 content::NotificationService::AllSources()); | 172 content::NotificationService::AllSources()); |
178 registrar_.Add(this, | 173 registrar_.Add(this, |
179 chrome::NOTIFICATION_ASH_SESSION_ENDED, | 174 chrome::NOTIFICATION_ASH_SESSION_ENDED, |
180 content::NotificationService::AllSources()); | 175 content::NotificationService::AllSources()); |
181 #endif | 176 #endif |
182 } | 177 } |
OLD | NEW |