From 2edb5be9a3a08a9527cd04ad302ba2376a22c4d6 Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Sat, 16 Jan 2010 23:32:48 +0000 Subject: Reuse the existing tab when opening the Manage Extensions page and the Options page for an extension. Thanks to Phistuck for pointing this out. Also, use IDS_MANAGE_EXTENSIONS for all locales on dev (it will get translated in the next run). BUG=None TEST=Use the extension context menu and Manage Extensions and Configure should not open new tabs if that tab already exists. Review URL: http://codereview.chromium.org/551056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36463 0039d316-1c4b-4281-b951-d872f2087c98 --- .../extensions/extension_action_context_menu_model.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'chrome/browser/extensions') diff --git a/chrome/browser/extensions/extension_action_context_menu_model.cc b/chrome/browser/extensions/extension_action_context_menu_model.cc index 7c32719..1a0409a 100644 --- a/chrome/browser/extensions/extension_action_context_menu_model.cc +++ b/chrome/browser/extensions/extension_action_context_menu_model.cc @@ -33,14 +33,7 @@ ExtensionActionContextMenuModel::ExtensionActionContextMenuModel( AddItemWithStringId(UNINSTALL, IDS_EXTENSIONS_UNINSTALL); AddSeparator(); - // TODO(finnur): It is too late in the process to do another round of - // translations, so we'll switch fully to IDS_MANAGE_EXTENSIONS after merging - // this to the beta branch. :/ - std::string locale = g_browser_process->GetApplicationLocale(); - if (locale.find_first_of("en-") == 0) - AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSIONS); - else - AddItemWithStringId(MANAGE, IDS_SHOW_EXTENSIONS); + AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSIONS); } ExtensionActionContextMenuModel::~ExtensionActionContextMenuModel() { @@ -76,7 +69,7 @@ void ExtensionActionContextMenuModel::ExecuteCommand(int command_id) { case CONFIGURE: DCHECK(!extension_->options_url().is_empty()); browser->OpenURL(extension_->options_url(), GURL(), - NEW_FOREGROUND_TAB, PageTransition::LINK); + SINGLETON_TAB, PageTransition::LINK); break; case DISABLE: { ExtensionsService* extension_service = profile->GetExtensionsService(); @@ -94,7 +87,7 @@ void ExtensionActionContextMenuModel::ExecuteCommand(int command_id) { } case MANAGE: { browser->OpenURL(GURL(chrome::kChromeUIExtensionsURL), GURL(), - NEW_FOREGROUND_TAB, PageTransition::LINK); + SINGLETON_TAB, PageTransition::LINK); break; } default: -- cgit v1.1