Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate_views.cc

Issue 636853002: Common code from linux and windows implementations of SystemTrayDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/ash/system_tray_delegate_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ash/solid_color_user_wallpaper_delegate.h"
26 #include "chrome/browser/ui/ash/system_tray_delegate_common.h"
26 #include "chrome/browser/ui/browser.h" 27 #include "chrome/browser/ui/browser.h"
27 #include "chrome/browser/ui/browser_finder.h" 28 #include "chrome/browser/ui/browser_finder.h"
28 #include "chrome/browser/ui/browser_list.h" 29 #include "chrome/browser/ui/browser_list.h"
29 #include "chrome/browser/ui/browser_tabstrip.h" 30 #include "chrome/browser/ui/browser_tabstrip.h"
30 #include "chrome/browser/ui/browser_window.h" 31 #include "chrome/browser/ui/browser_window.h"
31 #include "chrome/browser/ui/host_desktop.h" 32 #include "chrome/browser/ui/host_desktop.h"
32 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" 33 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
33 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" 34 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
34 #include "chrome/common/chrome_switches.h" 35 #include "chrome/common/chrome_switches.h"
35 #include "content/public/browser/notification_service.h" 36 #include "content/public/browser/notification_service.h"
36 37
37 #if defined(OS_WIN)
38 #include "chrome/browser/ui/ash/system_tray_delegate_win.h"
39 #endif
40
41 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
42 #include "chrome/browser/ui/ash/system_tray_delegate_linux.h"
43 #endif
44
45 namespace { 38 namespace {
46 39
47 class NewWindowDelegateImpl : public ChromeNewWindowDelegate { 40 class NewWindowDelegateImpl : public ChromeNewWindowDelegate {
48 public: 41 public:
49 NewWindowDelegateImpl() {} 42 NewWindowDelegateImpl() {}
50 virtual ~NewWindowDelegateImpl() {} 43 virtual ~NewWindowDelegateImpl() {}
51 44
52 // Overridden from ash::NewWindowDelegate: 45 // Overridden from ash::NewWindowDelegate:
53 virtual void OpenFileManager() override {} 46 virtual void OpenFileManager() override {}
54 virtual void OpenCrosh() override {} 47 virtual void OpenCrosh() override {}
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 175
183 ash::MediaDelegate* ChromeShellDelegate::CreateMediaDelegate() { 176 ash::MediaDelegate* ChromeShellDelegate::CreateMediaDelegate() {
184 return new MediaDelegateImpl; 177 return new MediaDelegateImpl;
185 } 178 }
186 179
187 ash::SessionStateDelegate* ChromeShellDelegate::CreateSessionStateDelegate() { 180 ash::SessionStateDelegate* ChromeShellDelegate::CreateSessionStateDelegate() {
188 return new SessionStateDelegate; 181 return new SessionStateDelegate;
189 } 182 }
190 183
191 ash::SystemTrayDelegate* ChromeShellDelegate::CreateSystemTrayDelegate() { 184 ash::SystemTrayDelegate* ChromeShellDelegate::CreateSystemTrayDelegate() {
192 #if defined(OS_WIN) 185 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
193 return CreateWindowsSystemTrayDelegate(); 186 return CreateSystemTrayDelegate();
194 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
195 return CreateLinuxSystemTrayDelegate();
196 #else 187 #else
197 return new ash::DefaultSystemTrayDelegate; 188 return new DefaultSystemTrayDelegate();
sky 2014/10/08 15:39:53 AFAICT the else here is never hit. Am I wrong? Ass
ygorshenin1 2014/10/09 09:14:44 ChromeShellDelegate is instantiated and used in al
sky 2014/10/09 17:22:39 You made me look. See https://code.google.com/p/ch
ygorshenin1 2014/10/10 12:02:54 Done.
198 #endif 189 #endif
199 } 190 }
200 191
201 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() { 192 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() {
202 return new EmptyAccessibilityDelegate; 193 return new EmptyAccessibilityDelegate;
203 } 194 }
204 195
205 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() { 196 ash::UserWallpaperDelegate* ChromeShellDelegate::CreateUserWallpaperDelegate() {
206 return CreateSolidColorUserWallpaperDelegate(); 197 return CreateSolidColorUserWallpaperDelegate();
207 } 198 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 chrome::NOTIFICATION_PROFILE_ADDED, 275 chrome::NOTIFICATION_PROFILE_ADDED,
285 content::NotificationService::AllSources()); 276 content::NotificationService::AllSources());
286 registrar_.Add(this, 277 registrar_.Add(this,
287 chrome::NOTIFICATION_ASH_SESSION_STARTED, 278 chrome::NOTIFICATION_ASH_SESSION_STARTED,
288 content::NotificationService::AllSources()); 279 content::NotificationService::AllSources());
289 registrar_.Add(this, 280 registrar_.Add(this,
290 chrome::NOTIFICATION_ASH_SESSION_ENDED, 281 chrome::NOTIFICATION_ASH_SESSION_ENDED,
291 content::NotificationService::AllSources()); 282 content::NotificationService::AllSources());
292 #endif 283 #endif
293 } 284 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/system_tray_delegate_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698