Chromium Code Reviews| Index: chrome/browser/sync/sync_global_error.cc |
| diff --git a/chrome/browser/sync/sync_global_error.cc b/chrome/browser/sync/sync_global_error.cc |
| index faf79e44e3e7ecb7b85203de838ea9dc70ccf4a6..26b6b934dba91e0af247fc77c91647752de2b24e 100644 |
| --- a/chrome/browser/sync/sync_global_error.cc |
| +++ b/chrome/browser/sync/sync_global_error.cc |
| @@ -19,18 +19,14 @@ |
| #include "ui/base/l10n/l10n_util.h" |
| SyncGlobalError::SyncGlobalError( |
| - GlobalErrorService* global_error_service, |
| LoginUIService* login_ui_service, |
| syncer::SyncErrorController* error_controller, |
| browser_sync::ProfileSyncService* profile_sync_service) |
| - : global_error_service_(global_error_service), |
| - login_ui_service_(login_ui_service), |
| + : login_ui_service_(login_ui_service), |
| error_controller_(error_controller), |
| sync_service_(profile_sync_service) { |
| DCHECK(sync_service_); |
| error_controller_->AddObserver(this); |
| - if (!switches::IsMaterialDesignUserMenu()) |
| - global_error_service_->AddUnownedGlobalError(this); |
|
sky
2017/02/23 20:44:52
Who owns this class now?
jlebel
2017/03/06 13:09:29
Are you talking about SyncGlobalError?
SyncGlobal
sky
2017/03/06 18:50:40
Acknowledged.
|
| } |
| SyncGlobalError::~SyncGlobalError() { |
| @@ -39,8 +35,6 @@ SyncGlobalError::~SyncGlobalError() { |
| } |
| void SyncGlobalError::Shutdown() { |
| - if (!switches::IsMaterialDesignUserMenu()) |
| - global_error_service_->RemoveUnownedGlobalError(this); |
| error_controller_->RemoveObserver(this); |
| error_controller_ = nullptr; |
| } |
| @@ -98,27 +92,4 @@ void SyncGlobalError::BubbleViewCancelButtonPressed(Browser* browser) { |
| } |
| void SyncGlobalError::OnErrorChanged() { |
| - if (switches::IsMaterialDesignUserMenu()) |
| - return; |
| - |
| - base::string16 menu_label; |
| - base::string16 bubble_message; |
| - base::string16 bubble_accept_label; |
| - sync_ui_util::GetStatusLabelsForSyncGlobalError( |
| - sync_service_, &menu_label, &bubble_message, &bubble_accept_label); |
| - |
| - // All the labels should be empty or all of them non-empty. |
| - DCHECK((menu_label.empty() && bubble_message.empty() && |
| - bubble_accept_label.empty()) || |
| - (!menu_label.empty() && !bubble_message.empty() && |
| - !bubble_accept_label.empty())); |
| - |
| - if (menu_label != menu_label_ || bubble_message != bubble_message_ || |
| - bubble_accept_label != bubble_accept_label_) { |
| - menu_label_ = menu_label; |
| - bubble_message_ = bubble_message; |
| - bubble_accept_label_ = bubble_accept_label; |
| - |
| - global_error_service_->NotifyErrorsChanged(this); |
| - } |
| } |