OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/prefs/public/pref_change_registrar.h" | 8 #include "base/prefs/public/pref_change_registrar.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "chrome/browser/extensions/extension_action.h" | 10 #include "chrome/browser/extensions/extension_action.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 class AsyncUninstaller : public ExtensionUninstallDialog::Delegate { | 52 class AsyncUninstaller : public ExtensionUninstallDialog::Delegate { |
53 public: | 53 public: |
54 AsyncUninstaller(const Extension* extension, Browser* browser) | 54 AsyncUninstaller(const Extension* extension, Browser* browser) |
55 : extension_(extension), | 55 : extension_(extension), |
56 profile_(browser->profile()) { | 56 profile_(browser->profile()) { |
57 extension_uninstall_dialog_.reset( | 57 extension_uninstall_dialog_.reset( |
58 ExtensionUninstallDialog::Create(profile_, browser, this)); | 58 ExtensionUninstallDialog::Create(profile_, browser, this)); |
59 extension_uninstall_dialog_->ConfirmUninstall(extension_); | 59 extension_uninstall_dialog_->ConfirmUninstall(extension_); |
60 } | 60 } |
61 | 61 |
62 ~AsyncUninstaller() {} | 62 virtual ~AsyncUninstaller() {} |
63 | 63 |
64 // ExtensionUninstallDialog::Delegate: | 64 // ExtensionUninstallDialog::Delegate: |
65 virtual void ExtensionUninstallAccepted() { | 65 virtual void ExtensionUninstallAccepted() OVERRIDE { |
66 extensions::ExtensionSystem::Get(profile_)->extension_service()-> | 66 extensions::ExtensionSystem::Get(profile_)->extension_service()-> |
67 UninstallExtension(extension_->id(), false, NULL); | 67 UninstallExtension(extension_->id(), false, NULL); |
68 } | 68 } |
69 virtual void ExtensionUninstallCanceled() {} | 69 virtual void ExtensionUninstallCanceled() OVERRIDE {} |
70 | 70 |
71 private: | 71 private: |
72 // The extension that we're loading the icon for. Weak. | 72 // The extension that we're loading the icon for. Weak. |
73 const Extension* extension_; | 73 const Extension* extension_; |
74 | 74 |
75 // The current profile. Weak. | 75 // The current profile. Weak. |
76 Profile* profile_; | 76 Profile* profile_; |
77 | 77 |
78 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_; | 78 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_; |
79 | 79 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { | 275 - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { |
276 if ([menuItem tag] == kExtensionContextOptions) { | 276 if ([menuItem tag] == kExtensionContextOptions) { |
277 // Disable 'Options' if there are no options to set. | 277 // Disable 'Options' if there are no options to set. |
278 return extensions::ManifestURL:: | 278 return extensions::ManifestURL:: |
279 GetOptionsPage(extension_).spec().length() > 0; | 279 GetOptionsPage(extension_).spec().length() > 0; |
280 } | 280 } |
281 return YES; | 281 return YES; |
282 } | 282 } |
283 | 283 |
284 @end | 284 @end |
OLD | NEW |