| Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| index d07ce2fa923a24906645d66ff2193cbaebc095d7..36d9fb3b4299bca85702dd28a0430f328759c530 100644
|
| --- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| +++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| @@ -109,6 +109,9 @@ const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds.
|
| // The maximum session length limit that can be set.
|
| const int kSessionLengthLimitMaxMs = 24 * 60 * 60 * 1000; // 24 hours.
|
|
|
| +// A pointer so that callers can access the single class instance.
|
| +SystemTrayDelegateChromeOS* g_instance = nullptr;
|
| +
|
| void ExtractIMEInfo(const input_method::InputMethodDescriptor& ime,
|
| const input_method::InputMethodUtil& util,
|
| ash::IMEInfo* info) {
|
| @@ -173,6 +176,9 @@ SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
|
| base::Unretained(this)));
|
|
|
| user_manager::UserManager::Get()->AddSessionStateObserver(this);
|
| +
|
| + DCHECK(!g_instance);
|
| + g_instance = this;
|
| }
|
|
|
| void SystemTrayDelegateChromeOS::Initialize() {
|
| @@ -222,6 +228,9 @@ void SystemTrayDelegateChromeOS::InitializeOnAdapterReady(
|
| }
|
|
|
| SystemTrayDelegateChromeOS::~SystemTrayDelegateChromeOS() {
|
| + DCHECK_EQ(this, g_instance);
|
| + g_instance = nullptr;
|
| +
|
| // Unregister PrefChangeRegistrars.
|
| local_state_registrar_.reset();
|
| user_pref_registrar_.reset();
|
| @@ -315,6 +324,7 @@ bool SystemTrayDelegateChromeOS::IsUserChild() const {
|
| void SystemTrayDelegateChromeOS::GetSystemUpdateInfo(
|
| ash::UpdateInfo* info) const {
|
| GetUpdateInfo(UpgradeDetector::GetInstance(), info);
|
| + info->component_update_required = flash_update_available_;
|
| }
|
|
|
| bool SystemTrayDelegateChromeOS::ShouldShowSettings() const {
|
| @@ -1006,4 +1016,17 @@ ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
|
| return new SystemTrayDelegateChromeOS();
|
| }
|
|
|
| +// static
|
| +SystemTrayDelegateChromeOS* SystemTrayDelegateChromeOS::Get() {
|
| + return g_instance;
|
| +}
|
| +
|
| +void SystemTrayDelegateChromeOS::SetFlashUpdateAvailable() {
|
| + flash_update_available_ = true;
|
| +
|
| + ash::UpdateInfo info;
|
| + GetSystemUpdateInfo(&info);
|
| + GetSystemTrayNotifier()->NotifyUpdateRecommended(info);
|
| +}
|
| +
|
| } // namespace chromeos
|
|
|