OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_contro
ller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu_contro
ller.h" |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
9 #include "chrome/browser/extensions/extension_action_manager.h" | 9 #include "chrome/browser/extensions/extension_action_manager.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
32 #include "ui/base/l10n/l10n_util_mac.h" | 32 #include "ui/base/l10n/l10n_util_mac.h" |
33 | 33 |
34 using content::OpenURLParams; | 34 using content::OpenURLParams; |
35 using content::Referrer; | 35 using content::Referrer; |
36 using content::WebContents; | 36 using content::WebContents; |
37 using extensions::Extension; | 37 using extensions::Extension; |
38 | 38 |
39 // A class that shows a confirmation dialog to uninstall the given extension. | 39 // A class that shows a confirmation dialog to uninstall the given extension. |
40 // Also acts as the extension's UI delegate in order to display the dialog. | 40 // Also acts as the extension's UI delegate in order to display the dialog. |
41 class AsyncUninstaller : public ExtensionUninstallDialog::Delegate { | 41 class AsyncUninstaller : public extensions::ExtensionUninstallDialog::Delegate { |
42 public: | 42 public: |
43 AsyncUninstaller(const Extension* extension, Browser* browser) | 43 AsyncUninstaller(const Extension* extension, Browser* browser) |
44 : extension_(extension), | 44 : extension_(extension), |
45 profile_(browser->profile()) { | 45 profile_(browser->profile()) { |
46 extension_uninstall_dialog_.reset( | 46 extension_uninstall_dialog_.reset( |
47 ExtensionUninstallDialog::Create(profile_, browser, this)); | 47 extensions::ExtensionUninstallDialog::Create(profile_, browser, this)); |
48 extension_uninstall_dialog_->ConfirmUninstall(extension_); | 48 extension_uninstall_dialog_->ConfirmUninstall(extension_); |
49 } | 49 } |
50 | 50 |
51 virtual ~AsyncUninstaller() {} | 51 virtual ~AsyncUninstaller() {} |
52 | 52 |
53 // ExtensionUninstallDialog::Delegate: | 53 // ExtensionUninstallDialog::Delegate: |
54 virtual void ExtensionUninstallAccepted() OVERRIDE { | 54 virtual void ExtensionUninstallAccepted() OVERRIDE { |
55 extensions::ExtensionSystem::Get(profile_)->extension_service()-> | 55 extensions::ExtensionSystem::Get(profile_)->extension_service()-> |
56 UninstallExtension(extension_->id(), false, NULL); | 56 UninstallExtension(extension_->id(), false, NULL); |
57 } | 57 } |
58 virtual void ExtensionUninstallCanceled() OVERRIDE {} | 58 virtual void ExtensionUninstallCanceled() OVERRIDE {} |
59 | 59 |
60 private: | 60 private: |
61 // The extension that's being uninstalled. | 61 // The extension that's being uninstalled. |
62 const Extension* extension_; | 62 const Extension* extension_; |
63 | 63 |
64 // The current profile. Weak. | 64 // The current profile. Weak. |
65 Profile* profile_; | 65 Profile* profile_; |
66 | 66 |
67 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_; | 67 scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(AsyncUninstaller); | 69 DISALLOW_COPY_AND_ASSIGN(AsyncUninstaller); |
70 }; | 70 }; |
71 | 71 |
72 @interface ExtensionActionContextMenuController () | 72 @interface ExtensionActionContextMenuController () |
73 - (void)onExtensionName:(id)sender; | 73 - (void)onExtensionName:(id)sender; |
74 - (void)onOptions:(id)sender; | 74 - (void)onOptions:(id)sender; |
75 - (void)onUninstall:(id)sender; | 75 - (void)onUninstall:(id)sender; |
76 - (void)onHide:(id)sender; | 76 - (void)onHide:(id)sender; |
77 - (void)onManage:(id)sender; | 77 - (void)onManage:(id)sender; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 return; | 218 return; |
219 | 219 |
220 [ExtensionPopupController showURL:url | 220 [ExtensionPopupController showURL:url |
221 inBrowser:browser_ | 221 inBrowser:browser_ |
222 anchoredAt:popupPoint | 222 anchoredAt:popupPoint |
223 arrowLocation:info_bubble::kTopRight | 223 arrowLocation:info_bubble::kTopRight |
224 devMode:YES]; | 224 devMode:YES]; |
225 } | 225 } |
226 | 226 |
227 @end | 227 @end |
OLD | NEW |