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

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

Issue 614363002: Added Aura notification that relaunch and powerwash is required in case of downgrade. (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
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 <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" 64 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
65 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" 65 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h"
66 #include "chrome/browser/chromeos/profiles/profile_helper.h" 66 #include "chrome/browser/chromeos/profiles/profile_helper.h"
67 #include "chrome/browser/chromeos/set_time_dialog.h" 67 #include "chrome/browser/chromeos/set_time_dialog.h"
68 #include "chrome/browser/chromeos/settings/cros_settings.h" 68 #include "chrome/browser/chromeos/settings/cros_settings.h"
69 #include "chrome/browser/chromeos/sim_dialog_delegate.h" 69 #include "chrome/browser/chromeos/sim_dialog_delegate.h"
70 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" 70 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h"
71 #include "chrome/browser/lifetime/application_lifetime.h" 71 #include "chrome/browser/lifetime/application_lifetime.h"
72 #include "chrome/browser/profiles/profile_manager.h" 72 #include "chrome/browser/profiles/profile_manager.h"
73 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 73 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
74 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h"
74 #include "chrome/browser/ui/ash/user_accounts_delegate_chromeos.h" 75 #include "chrome/browser/ui/ash/user_accounts_delegate_chromeos.h"
75 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" 76 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
76 #include "chrome/browser/ui/browser.h" 77 #include "chrome/browser/ui/browser.h"
77 #include "chrome/browser/ui/browser_finder.h" 78 #include "chrome/browser/ui/browser_finder.h"
78 #include "chrome/browser/ui/browser_list.h" 79 #include "chrome/browser/ui/browser_list.h"
79 #include "chrome/browser/ui/chrome_pages.h" 80 #include "chrome/browser/ui/chrome_pages.h"
80 #include "chrome/browser/ui/host_desktop.h" 81 #include "chrome/browser/ui/host_desktop.h"
81 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" 82 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
82 #include "chrome/browser/ui/singleton_tabs.h" 83 #include "chrome/browser/ui/singleton_tabs.h"
83 #include "chrome/browser/ui/tabs/tab_strip_model.h" 84 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 return l10n_util::GetStringFUTF16( 400 return l10n_util::GetStringFUTF16(
400 IDS_USER_IS_SUPERVISED_BY_NOTICE, 401 IDS_USER_IS_SUPERVISED_BY_NOTICE,
401 base::UTF8ToUTF16(GetSupervisedUserManager())); 402 base::UTF8ToUTF16(GetSupervisedUserManager()));
402 } 403 }
403 404
404 bool SystemTrayDelegateChromeOS::IsUserSupervised() const { 405 bool SystemTrayDelegateChromeOS::IsUserSupervised() const {
405 user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser(); 406 user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser();
406 return user && user->IsSupervised(); 407 return user && user->IsSupervised();
407 } 408 }
408 409
409 bool SystemTrayDelegateChromeOS::SystemShouldUpgrade() const { 410 void SystemTrayDelegateChromeOS::GetSystemUpdateInfo(
410 return UpgradeDetector::GetInstance()->notify_upgrade(); 411 ash::UpdateInfo* info) const {
412 system_tray_delegate_utils::GetUpdateInfo(UpgradeDetector::GetInstance(),
413 info);
411 } 414 }
412 415
413 base::HourClockType SystemTrayDelegateChromeOS::GetHourClockType() const { 416 base::HourClockType SystemTrayDelegateChromeOS::GetHourClockType() const {
414 return clock_type_; 417 return clock_type_;
415 } 418 }
416 419
417 void SystemTrayDelegateChromeOS::ShowSettings() { 420 void SystemTrayDelegateChromeOS::ShowSettings() {
418 ShowSettingsSubPageForActiveUser(""); 421 ShowSettingsSubPageForActiveUser("");
419 } 422 }
420 423
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 return GetNativeWindowByStatus(GetUserLoginStatus(), session_started); 1083 return GetNativeWindowByStatus(GetUserLoginStatus(), session_started);
1081 } 1084 }
1082 1085
1083 // content::NotificationObserver implementation. 1086 // content::NotificationObserver implementation.
1084 void SystemTrayDelegateChromeOS::Observe( 1087 void SystemTrayDelegateChromeOS::Observe(
1085 int type, 1088 int type,
1086 const content::NotificationSource& source, 1089 const content::NotificationSource& source,
1087 const content::NotificationDetails& details) { 1090 const content::NotificationDetails& details) {
1088 switch (type) { 1091 switch (type) {
1089 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: { 1092 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: {
1090 UpgradeDetector* detector = 1093 ash::UpdateInfo info;
1091 content::Source<UpgradeDetector>(source).ptr(); 1094 system_tray_delegate_utils::GetUpdateInfo(
1092 ash::UpdateObserver::UpdateSeverity severity = 1095 content::Source<UpgradeDetector>(source).ptr(), &info);
1093 ash::UpdateObserver::UPDATE_NORMAL; 1096 GetSystemTrayNotifier()->NotifyUpdateRecommended(info);
1094 switch (detector->upgrade_notification_stage()) {
1095 case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE:
1096 severity = ash::UpdateObserver::UPDATE_SEVERE_RED;
1097 break;
1098
1099 case UpgradeDetector::UPGRADE_ANNOYANCE_HIGH:
1100 severity = ash::UpdateObserver::UPDATE_HIGH_ORANGE;
1101 break;
1102
1103 case UpgradeDetector::UPGRADE_ANNOYANCE_ELEVATED:
1104 severity = ash::UpdateObserver::UPDATE_LOW_GREEN;
1105 break;
1106
1107 case UpgradeDetector::UPGRADE_ANNOYANCE_LOW:
1108 default:
1109 severity = ash::UpdateObserver::UPDATE_NORMAL;
1110 break;
1111 }
1112 GetSystemTrayNotifier()->NotifyUpdateRecommended(severity);
1113 break; 1097 break;
1114 } 1098 }
1115 case chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED: { 1099 case chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED: {
1116 // This notification is also sent on login screen when user avatar 1100 // This notification is also sent on login screen when user avatar
1117 // is loaded from file. 1101 // is loaded from file.
1118 if (GetUserLoginStatus() != ash::user::LOGGED_IN_NONE) { 1102 if (GetUserLoginStatus() != ash::user::LOGGED_IN_NONE) {
1119 GetSystemTrayNotifier()->NotifyUserUpdate(); 1103 GetSystemTrayNotifier()->NotifyUserUpdate();
1120 } 1104 }
1121 break; 1105 break;
1122 } 1106 }
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 accessibility_subscription_.reset(); 1279 accessibility_subscription_.reset();
1296 else 1280 else
1297 OnAccessibilityModeChanged(details.notify); 1281 OnAccessibilityModeChanged(details.notify);
1298 } 1282 }
1299 1283
1300 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1284 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1301 return new SystemTrayDelegateChromeOS(); 1285 return new SystemTrayDelegateChromeOS();
1302 } 1286 }
1303 1287
1304 } // namespace chromeos 1288 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698