Commit 17508904 authored by janeliulwq's avatar janeliulwq Committed by Commit bot

Removed sync error menu item from the wrench menu (material design user menu only)

This is only for when #show-material-design-user-menu is enabled. For this case, sync error surfacing has been migrated to be in the user menu (https://codereview.chromium.org/2151513002/). Therefore, there shouldn't be a menu item in the wrench menu or any other surfacing UI for sync errors any more.

See project design doc: https://docs.google.com/document/d/17yHrKd_EU6WoIAgljnZmNCSJLRlbM3O2Pxr7aPEnqik/edit?ts=57445a70#heading=h.6xrfx2rucezz

BUG=615893

Review-Url: https://codereview.chromium.org/2168713002
Cr-Commit-Position: refs/heads/master@{#406677}
parent ea959b13
......@@ -14,6 +14,7 @@
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/browser_sync/browser/profile_sync_service.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "ui/base/l10n/l10n_util.h"
......@@ -27,6 +28,7 @@ SyncGlobalError::SyncGlobalError(GlobalErrorService* global_error_service,
sync_service_(profile_sync_service) {
DCHECK(sync_service_);
error_controller_->AddObserver(this);
if (!switches::IsMaterialDesignUserMenu())
global_error_service_->AddGlobalError(this);
}
......@@ -36,6 +38,7 @@ SyncGlobalError::~SyncGlobalError() {
}
void SyncGlobalError::Shutdown() {
if (!switches::IsMaterialDesignUserMenu())
global_error_service_->RemoveGlobalError(this);
error_controller_->RemoveObserver(this);
error_controller_ = NULL;
......@@ -94,6 +97,9 @@ 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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment