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

Unified Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 2933923002: Remove update icon after user confirms download (Closed)
Patch Set: Add initialized_ Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | chromeos/dbus/update_engine_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 67648c4cd8ec5af24657641c260d6fc4ac77a25f..cff81505c443b379ab262bc448b37f540285699e 100644
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
@@ -46,6 +46,7 @@
#include "chrome/common/features.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/login/login_state.h"
#include "chromeos/network/portal_detector/network_portal_detector.h"
#include "components/google/core/browser/google_util.h"
@@ -89,7 +90,8 @@ void OnAcceptMultiprofilesIntro(bool no_show_again) {
SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
: networking_config_delegate_(
- base::MakeUnique<NetworkingConfigDelegateChromeos>()) {
+ base::MakeUnique<NetworkingConfigDelegateChromeos>()),
+ initialized_(false) {
// Register notifications on construction so that events such as
// PROFILE_CREATED do not get missed if they happen before Initialize().
registrar_.reset(new content::NotificationRegistrar);
@@ -117,8 +119,10 @@ void SystemTrayDelegateChromeOS::Initialize() {
input_method::InputMethodManager::Get()->AddObserver(this);
input_method::InputMethodManager::Get()->AddImeMenuObserver(this);
ui::ime::InputMethodMenuManager::GetInstance()->AddObserver(this);
-
BrowserList::AddObserver(this);
+ DBusThreadManager::Get()->GetUpdateEngineClient()->AddObserver(this);
+
+ initialized_ = true;
}
SystemTrayDelegateChromeOS::~SystemTrayDelegateChromeOS() {
@@ -130,11 +134,15 @@ SystemTrayDelegateChromeOS::~SystemTrayDelegateChromeOS() {
// Unregister a11y status subscription.
accessibility_subscription_.reset();
- input_method::InputMethodManager::Get()->RemoveObserver(this);
- ui::ime::InputMethodMenuManager::GetInstance()->RemoveObserver(this);
-
- BrowserList::RemoveObserver(this);
StopObservingAppWindowRegistry();
+
+ if (initialized_) {
stevenjb 2017/06/13 20:29:53 This is not actually what I was suggesting, althou
+ input_method::InputMethodManager::Get()->RemoveObserver(this);
+ input_method::InputMethodManager::Get()->RemoveImeMenuObserver(this);
+ ui::ime::InputMethodMenuManager::GetInstance()->RemoveObserver(this);
+ BrowserList::RemoveObserver(this);
+ DBusThreadManager::Get()->GetUpdateEngineClient()->RemoveObserver(this);
stevenjb 2017/06/13 20:29:53 With or without |initiaizled_|, this should be: i
weidongg 2017/06/13 20:51:25 Aha, I see. Thanks for explanation. Done.
+ }
}
void SystemTrayDelegateChromeOS::ShowUserLogin() {
@@ -440,6 +448,10 @@ void SystemTrayDelegateChromeOS::ImeMenuItemsChanged(
const std::string& engine_id,
const std::vector<input_method::InputMethodManager::MenuItem>& items) {}
+void SystemTrayDelegateChromeOS::OnUpdateOverCellularTargetSet(bool success) {
+ GetSystemTrayNotifier()->NotifyUpdateOverCellularTargetSet(success);
+}
+
ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
return new SystemTrayDelegateChromeOS();
}
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | chromeos/dbus/update_engine_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698