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

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

Issue 2864663002: cros: Merge SystemTrayDelegate::GetUserLoginStatus (Closed)
Patch Set: update PaletteTray to exclude ARC kiosk Created 3 years, 7 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 | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | no next file » | 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/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>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 } // namespace 99 } // namespace
100 100
101 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() 101 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
102 : networking_config_delegate_( 102 : networking_config_delegate_(
103 base::MakeUnique<NetworkingConfigDelegateChromeos>()) { 103 base::MakeUnique<NetworkingConfigDelegateChromeos>()) {
104 // Register notifications on construction so that events such as 104 // Register notifications on construction so that events such as
105 // PROFILE_CREATED do not get missed if they happen before Initialize(). 105 // PROFILE_CREATED do not get missed if they happen before Initialize().
106 registrar_.reset(new content::NotificationRegistrar); 106 registrar_.reset(new content::NotificationRegistrar);
107 if (GetUserLoginStatus() == ash::LoginStatus::NOT_LOGGED_IN) { 107 if (SystemTrayClient::GetUserLoginStatus() ==
108 ash::LoginStatus::NOT_LOGGED_IN) {
108 registrar_->Add(this, 109 registrar_->Add(this,
109 chrome::NOTIFICATION_SESSION_STARTED, 110 chrome::NOTIFICATION_SESSION_STARTED,
110 content::NotificationService::AllSources()); 111 content::NotificationService::AllSources());
111 } 112 }
112 registrar_->Add(this, 113 registrar_->Add(this,
113 chrome::NOTIFICATION_PROFILE_CREATED, 114 chrome::NOTIFICATION_PROFILE_CREATED,
114 content::NotificationService::AllSources()); 115 content::NotificationService::AllSources());
115 registrar_->Add(this, 116 registrar_->Add(this,
116 chrome::NOTIFICATION_PROFILE_DESTROYED, 117 chrome::NOTIFICATION_PROFILE_DESTROYED,
117 content::NotificationService::AllSources()); 118 content::NotificationService::AllSources());
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // Unregister a11y status subscription. 158 // Unregister a11y status subscription.
158 accessibility_subscription_.reset(); 159 accessibility_subscription_.reset();
159 160
160 input_method::InputMethodManager::Get()->RemoveObserver(this); 161 input_method::InputMethodManager::Get()->RemoveObserver(this);
161 ui::ime::InputMethodMenuManager::GetInstance()->RemoveObserver(this); 162 ui::ime::InputMethodMenuManager::GetInstance()->RemoveObserver(this);
162 163
163 BrowserList::RemoveObserver(this); 164 BrowserList::RemoveObserver(this);
164 StopObservingAppWindowRegistry(); 165 StopObservingAppWindowRegistry();
165 } 166 }
166 167
167 ash::LoginStatus SystemTrayDelegateChromeOS::GetUserLoginStatus() const {
168 return SystemTrayClient::GetUserLoginStatus();
169 }
170
171 void SystemTrayDelegateChromeOS::ShowUserLogin() { 168 void SystemTrayDelegateChromeOS::ShowUserLogin() {
172 if (!ash::Shell::Get()->shell_delegate()->IsMultiProfilesEnabled()) 169 if (!ash::Shell::Get()->shell_delegate()->IsMultiProfilesEnabled())
173 return; 170 return;
174 171
175 // Only regular non-supervised users could add other users to current session. 172 // Only regular non-supervised users could add other users to current session.
176 if (user_manager::UserManager::Get()->GetActiveUser()->GetType() != 173 if (user_manager::UserManager::Get()->GetActiveUser()->GetType() !=
177 user_manager::USER_TYPE_REGULAR) { 174 user_manager::USER_TYPE_REGULAR) {
178 return; 175 return;
179 } 176 }
180 177
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 524
528 void SystemTrayDelegateChromeOS::ImeMenuItemsChanged( 525 void SystemTrayDelegateChromeOS::ImeMenuItemsChanged(
529 const std::string& engine_id, 526 const std::string& engine_id,
530 const std::vector<input_method::InputMethodManager::MenuItem>& items) {} 527 const std::vector<input_method::InputMethodManager::MenuItem>& items) {}
531 528
532 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 529 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
533 return new SystemTrayDelegateChromeOS(); 530 return new SystemTrayDelegateChromeOS();
534 } 531 }
535 532
536 } // namespace chromeos 533 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698