| Index: chrome/browser/ui/toolbar/wrench_menu_model.cc
|
| diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
|
| index b4b2a6774ce220e899583e09edd8d9e68c9aa5fe..b174d982fb6a0ca4ff93aa4476ef5b174883de6e 100644
|
| --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
|
| +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
|
| @@ -19,6 +19,7 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/sync/sync_ui_util.h"
|
| +#include "chrome/browser/sync/sync_global_error.h"
|
| #include "chrome/browser/tabs/tab_strip_model.h"
|
| #include "chrome/browser/task_manager/task_manager.h"
|
| #include "chrome/browser/ui/browser.h"
|
| @@ -291,6 +292,9 @@ string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const {
|
| case IDC_SHOW_SYNC_SETUP: {
|
| ProfileSyncService* service =
|
| browser_->GetProfile()->GetOriginalProfile()->GetProfileSyncService();
|
| + SyncGlobalError* error = service->sync_global_error();
|
| + if (error && error->HasCustomizedSyncMenuItem())
|
| + return error->MenuItemLabel();
|
| if (service->HasSyncSetupCompleted()) {
|
| std::string username = browser_->GetProfile()->GetPrefs()->GetString(
|
| prefs::kGoogleServicesUsername);
|
| @@ -319,6 +323,20 @@ bool WrenchMenuModel::GetIconForCommandId(int command_id,
|
| UpgradeDetector::UPGRADE_ICON_TYPE_MENU_ICON));
|
| return true;
|
| }
|
| + return false;
|
| + }
|
| + case IDC_SHOW_SYNC_SETUP: {
|
| + ProfileSyncService* service =
|
| + browser_->GetProfile()->GetOriginalProfile()->GetProfileSyncService();
|
| + SyncGlobalError* error = service->sync_global_error();
|
| + if (error && error->HasCustomizedSyncMenuItem()) {
|
| + int icon_id = error->MenuItemIconResourceID();
|
| + if (icon_id) {
|
| + *icon = rb.GetNativeImageNamed(icon_id);
|
| + return true;
|
| + }
|
| + }
|
| + return false;
|
| }
|
| default:
|
| break;
|
| @@ -334,6 +352,16 @@ void WrenchMenuModel::ExecuteCommand(int command_id) {
|
| return;
|
| }
|
|
|
| + if (command_id == IDC_SHOW_SYNC_SETUP) {
|
| + ProfileSyncService* service =
|
| + browser_->GetProfile()->GetOriginalProfile()->GetProfileSyncService();
|
| + SyncGlobalError* error = service->sync_global_error();
|
| + if (error && error->HasCustomizedSyncMenuItem()) {
|
| + error->ExecuteMenuItem(browser_);
|
| + return;
|
| + }
|
| + }
|
| +
|
| if (command_id == IDC_HELP_PAGE)
|
| UserMetrics::RecordAction(UserMetricsAction("ShowHelpTabViaWrenchMenu"));
|
|
|
|
|