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 1e48730597cfb8fb9f4c0c5736273d4b427adb40..616d696493cd0caf904dcd5960ac59b74adb3c82 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")); |