| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/extension_action_context_menu_model.h" | 5 #include "chrome/browser/extensions/extension_action_context_menu_model.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extensions_service.h" | 10 #include "chrome/browser/extensions/extensions_service.h" |
| 11 #include "chrome/browser/profile.h" | 11 #include "chrome/browser/profile.h" |
| 12 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
| 13 #include "chrome/common/extensions/extension_constants.h" | 13 #include "chrome/common/extensions/extension_constants.h" |
| 14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
| 15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 16 | 16 |
| 17 enum MenuEntries { | 17 enum MenuEntries { |
| 18 NAME = 0, | 18 NAME = 0, |
| 19 CONFIGURE, | 19 CONFIGURE, |
| 20 DISABLE, | 20 DISABLE, |
| 21 UNINSTALL, | 21 UNINSTALL, |
| 22 MANAGE, | 22 MANAGE, |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 ExtensionActionContextMenuModel::ExtensionActionContextMenuModel( | 25 ExtensionActionContextMenuModel::ExtensionActionContextMenuModel( |
| 26 Extension* extension, ExtensionInstallUI::Delegate* delegate) | 26 Extension* extension, ExtensionInstallUI::Delegate* delegate) |
| 27 : ALLOW_THIS_IN_INITIALIZER_LIST(SimpleMenuModel(this)), | 27 : ALLOW_THIS_IN_INITIALIZER_LIST(SimpleMenuModel(this)), |
| 28 extension_(extension), | 28 extension_(extension), |
| 29 delegate_(delegate) { | 29 delegate_(delegate) { |
| 30 AddItem(NAME, ASCIIToUTF16(extension->name())); | 30 AddItem(NAME, UTF8ToUTF16(extension->name())); |
| 31 AddSeparator(); | 31 AddSeparator(); |
| 32 AddItemWithStringId(CONFIGURE, IDS_EXTENSIONS_OPTIONS); | 32 AddItemWithStringId(CONFIGURE, IDS_EXTENSIONS_OPTIONS); |
| 33 AddItemWithStringId(DISABLE, IDS_EXTENSIONS_DISABLE); | 33 AddItemWithStringId(DISABLE, IDS_EXTENSIONS_DISABLE); |
| 34 AddItemWithStringId(UNINSTALL, IDS_EXTENSIONS_UNINSTALL); | 34 AddItemWithStringId(UNINSTALL, IDS_EXTENSIONS_UNINSTALL); |
| 35 AddSeparator(); | 35 AddSeparator(); |
| 36 | 36 |
| 37 // TODO(finnur): It is too late in the process to do another round of | 37 // TODO(finnur): It is too late in the process to do another round of |
| 38 // translations, so we'll switch fully to IDS_MANAGE_EXTENSIONS after merging | 38 // translations, so we'll switch fully to IDS_MANAGE_EXTENSIONS after merging |
| 39 // this to the beta branch. :/ | 39 // this to the beta branch. :/ |
| 40 std::string locale = g_browser_process->GetApplicationLocale(); | 40 std::string locale = g_browser_process->GetApplicationLocale(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 case MANAGE: { | 96 case MANAGE: { |
| 97 browser->OpenURL(GURL(chrome::kChromeUIExtensionsURL), GURL(), | 97 browser->OpenURL(GURL(chrome::kChromeUIExtensionsURL), GURL(), |
| 98 NEW_FOREGROUND_TAB, PageTransition::LINK); | 98 NEW_FOREGROUND_TAB, PageTransition::LINK); |
| 99 break; | 99 break; |
| 100 } | 100 } |
| 101 default: | 101 default: |
| 102 NOTREACHED() << "Unknown option"; | 102 NOTREACHED() << "Unknown option"; |
| 103 break; | 103 break; |
| 104 } | 104 } |
| 105 } | 105 } |
| OLD | NEW |