Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm

Issue 8879022: retry 113568 - extensions: remove install/uninstall terminology (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" 5 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h"
6 6
7 #include "base/sys_string_conversions.h" 7 #include "base/sys_string_conversions.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_tab_util.h" 10 #include "chrome/browser/extensions/extension_tab_util.h"
(...skipping 11 matching lines...) Expand all
22 #include "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" 22 #include "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
23 #include "chrome/common/chrome_notification_types.h" 23 #include "chrome/common/chrome_notification_types.h"
24 #include "chrome/common/extensions/extension.h" 24 #include "chrome/common/extensions/extension.h"
25 #include "chrome/common/extensions/extension_action.h" 25 #include "chrome/common/extensions/extension_action.h"
26 #include "chrome/common/extensions/extension_constants.h" 26 #include "chrome/common/extensions/extension_constants.h"
27 #include "chrome/common/pref_names.h" 27 #include "chrome/common/pref_names.h"
28 #include "chrome/common/url_constants.h" 28 #include "chrome/common/url_constants.h"
29 #include "content/public/browser/notification_observer.h" 29 #include "content/public/browser/notification_observer.h"
30 #include "content/public/browser/notification_details.h" 30 #include "content/public/browser/notification_details.h"
31 #include "content/public/browser/notification_source.h" 31 #include "content/public/browser/notification_source.h"
32 #include "grit/chromium_strings.h"
32 #include "grit/generated_resources.h" 33 #include "grit/generated_resources.h"
34 #include "ui/base/l10n/l10n_util.h"
33 #include "ui/base/l10n/l10n_util_mac.h" 35 #include "ui/base/l10n/l10n_util_mac.h"
34 36
35 // A class that loads the extension icon on the I/O thread before showing the 37 // A class that loads the extension icon on the I/O thread before showing the
36 // confirmation dialog to uninstall the given extension. 38 // confirmation dialog to uninstall the given extension.
37 // Also acts as the extension's UI delegate in order to display the dialog. 39 // Also acts as the extension's UI delegate in order to display the dialog.
38 class AsyncUninstaller : public ExtensionUninstallDialog::Delegate { 40 class AsyncUninstaller : public ExtensionUninstallDialog::Delegate {
39 public: 41 public:
40 AsyncUninstaller(const Extension* extension, Profile* profile) 42 AsyncUninstaller(const Extension* extension, Profile* profile)
41 : extension_(extension), 43 : extension_(extension),
42 profile_(profile) { 44 profile_(profile) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 if ((self = [super initWithTitle:@""])) { 163 if ((self = [super initWithTitle:@""])) {
162 action_ = action; 164 action_ = action;
163 extension_ = extension; 165 extension_ = extension;
164 profile_ = profile; 166 profile_ = profile;
165 167
166 NSArray* menuItems = [NSArray arrayWithObjects: 168 NSArray* menuItems = [NSArray arrayWithObjects:
167 base::SysUTF8ToNSString(extension->name()), 169 base::SysUTF8ToNSString(extension->name()),
168 [NSMenuItem separatorItem], 170 [NSMenuItem separatorItem],
169 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_OPTIONS), 171 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_OPTIONS),
170 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_DISABLE), 172 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_DISABLE),
171 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_UNINSTALL), 173 l10n_util::GetNSStringFWithFixup(
174 IDS_EXTENSIONS_UNINSTALL,
175 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)),
172 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_HIDE_BUTTON), 176 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_HIDE_BUTTON),
173 [NSMenuItem separatorItem], 177 [NSMenuItem separatorItem],
174 l10n_util::GetNSStringWithFixup(IDS_MANAGE_EXTENSIONS), 178 l10n_util::GetNSStringWithFixup(IDS_MANAGE_EXTENSIONS),
175 nil]; 179 nil];
176 180
177 for (id item in menuItems) { 181 for (id item in menuItems) {
178 if ([item isKindOfClass:[NSMenuItem class]]) { 182 if ([item isKindOfClass:[NSMenuItem class]]) {
179 [self addItem:item]; 183 [self addItem:item];
180 } else if ([item isKindOfClass:[NSString class]]) { 184 } else if ([item isKindOfClass:[NSString class]]) {
181 NSMenuItem* itemObj = [self addItemWithTitle:item 185 NSMenuItem* itemObj = [self addItemWithTitle:item
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 321 }
318 return YES; 322 return YES;
319 } 323 }
320 324
321 - (void)invalidateProfile { 325 - (void)invalidateProfile {
322 observer_.reset(); 326 observer_.reset();
323 profile_ = NULL; 327 profile_ = NULL;
324 } 328 }
325 329
326 @end 330 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698