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

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

Issue 2741273002: chromeos: Promotes more from WmShell to Shell (Closed)
Patch Set: feedback Created 3 years, 9 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
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/system_tray_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <utility> 13 #include <utility>
14 #include <vector> 14 #include <vector>
15 15
16 #include "ash/common/login_status.h" 16 #include "ash/common/login_status.h"
17 #include "ash/common/shell_delegate.h" 17 #include "ash/common/shell_delegate.h"
18 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h" 18 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h"
19 #include "ash/common/system/chromeos/power/power_status.h" 19 #include "ash/common/system/chromeos/power/power_status.h"
20 #include "ash/common/system/chromeos/session/logout_button_observer.h" 20 #include "ash/common/system/chromeos/session/logout_button_observer.h"
21 #include "ash/common/system/date/clock_observer.h" 21 #include "ash/common/system/date/clock_observer.h"
22 #include "ash/common/system/ime/ime_observer.h" 22 #include "ash/common/system/ime/ime_observer.h"
23 #include "ash/common/system/tray/system_tray_notifier.h" 23 #include "ash/common/system/tray/system_tray_notifier.h"
24 #include "ash/common/system/tray_accessibility.h" 24 #include "ash/common/system/tray_accessibility.h"
25 #include "ash/common/system/user/user_observer.h" 25 #include "ash/common/system/user/user_observer.h"
26 #include "ash/common/wm_shell.h" 26 #include "ash/common/wm_shell.h"
27 #include "ash/shell.h"
27 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" 28 #include "ash/system/chromeos/rotation/tray_rotation_lock.h"
28 #include "base/bind_helpers.h" 29 #include "base/bind_helpers.h"
29 #include "base/callback.h" 30 #include "base/callback.h"
30 #include "base/logging.h" 31 #include "base/logging.h"
31 #include "base/memory/ptr_util.h" 32 #include "base/memory/ptr_util.h"
32 #include "base/memory/weak_ptr.h" 33 #include "base/memory/weak_ptr.h"
33 #include "base/metrics/user_metrics.h" 34 #include "base/metrics/user_metrics.h"
34 #include "base/strings/utf_string_conversions.h" 35 #include "base/strings/utf_string_conversions.h"
35 #include "base/sys_info.h" 36 #include "base/sys_info.h"
36 #include "base/time/time.h" 37 #include "base/time/time.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE); 317 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE);
317 } else { 318 } else {
318 chrome::ScopedTabbedBrowserDisplayer displayer( 319 chrome::ScopedTabbedBrowserDisplayer displayer(
319 ProfileManager::GetActiveUserProfile()); 320 ProfileManager::GetActiveUserProfile());
320 chrome::ShowSingletonTab(displayer.browser(), 321 chrome::ShowSingletonTab(displayer.browser(),
321 GURL(chrome::kLearnMoreEnterpriseURL)); 322 GURL(chrome::kLearnMoreEnterpriseURL));
322 } 323 }
323 } 324 }
324 325
325 void SystemTrayDelegateChromeOS::ShowUserLogin() { 326 void SystemTrayDelegateChromeOS::ShowUserLogin() {
326 ash::WmShell* wm_shell = ash::WmShell::Get(); 327 if (!ash::Shell::Get()->shell_delegate()->IsMultiProfilesEnabled())
327 if (!wm_shell->delegate()->IsMultiProfilesEnabled())
328 return; 328 return;
329 329
330 // Only regular non-supervised users could add other users to current session. 330 // Only regular non-supervised users could add other users to current session.
331 if (user_manager::UserManager::Get()->GetActiveUser()->GetType() != 331 if (user_manager::UserManager::Get()->GetActiveUser()->GetType() !=
332 user_manager::USER_TYPE_REGULAR) { 332 user_manager::USER_TYPE_REGULAR) {
333 return; 333 return;
334 } 334 }
335 335
336 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() >= 336 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() >=
337 session_manager::kMaxmiumNumberOfUserSessions) { 337 session_manager::kMaxmiumNumberOfUserSessions) {
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " 961 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while "
962 << "ENABLE_SUPERVISED_USERS undefined."; 962 << "ENABLE_SUPERVISED_USERS undefined.";
963 return base::string16(); 963 return base::string16();
964 } 964 }
965 965
966 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 966 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
967 return new SystemTrayDelegateChromeOS(); 967 return new SystemTrayDelegateChromeOS();
968 } 968 }
969 969
970 } // namespace chromeos 970 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698