OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 #include "content/public/browser/notification_observer.h" | 30 #include "content/public/browser/notification_observer.h" |
31 #include "content/public/browser/notification_details.h" | 31 #include "content/public/browser/notification_details.h" |
32 #include "content/public/browser/notification_source.h" | 32 #include "content/public/browser/notification_source.h" |
33 #include "grit/chromium_strings.h" | 33 #include "grit/chromium_strings.h" |
34 #include "grit/generated_resources.h" | 34 #include "grit/generated_resources.h" |
35 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
36 #include "ui/base/l10n/l10n_util_mac.h" | 36 #include "ui/base/l10n/l10n_util_mac.h" |
37 | 37 |
38 using content::OpenURLParams; | 38 using content::OpenURLParams; |
39 using content::Referrer; | 39 using content::Referrer; |
| 40 using content::WebContents; |
40 | 41 |
41 // A class that loads the extension icon on the I/O thread before showing the | 42 // A class that loads the extension icon on the I/O thread before showing the |
42 // confirmation dialog to uninstall the given extension. | 43 // confirmation dialog to uninstall the given extension. |
43 // Also acts as the extension's UI delegate in order to display the dialog. | 44 // Also acts as the extension's UI delegate in order to display the dialog. |
44 class AsyncUninstaller : public ExtensionUninstallDialog::Delegate { | 45 class AsyncUninstaller : public ExtensionUninstallDialog::Delegate { |
45 public: | 46 public: |
46 AsyncUninstaller(const Extension* extension, Profile* profile) | 47 AsyncUninstaller(const Extension* extension, Profile* profile) |
47 : extension_(extension), | 48 : extension_(extension), |
48 profile_(profile) { | 49 profile_(profile) { |
49 extension_uninstall_dialog_.reset( | 50 extension_uninstall_dialog_.reset( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 kExtensionContextUninstall = 4, | 147 kExtensionContextUninstall = 4, |
147 kExtensionContextHide = 5, | 148 kExtensionContextHide = 5, |
148 kExtensionContextManage = 7, | 149 kExtensionContextManage = 7, |
149 kExtensionContextInspect = 8 | 150 kExtensionContextInspect = 8 |
150 }; | 151 }; |
151 | 152 |
152 int CurrentTabId() { | 153 int CurrentTabId() { |
153 Browser* browser = BrowserList::GetLastActive(); | 154 Browser* browser = BrowserList::GetLastActive(); |
154 if(!browser) | 155 if(!browser) |
155 return -1; | 156 return -1; |
156 TabContents* contents = browser->GetSelectedTabContents(); | 157 WebContents* contents = browser->GetSelectedWebContents(); |
157 if (!contents) | 158 if (!contents) |
158 return -1; | 159 return -1; |
159 return ExtensionTabUtil::GetTabId(contents); | 160 return ExtensionTabUtil::GetTabId(contents); |
160 } | 161 } |
161 | 162 |
162 } // namespace | 163 } // namespace |
163 | 164 |
164 - (id)initWithExtension:(const Extension*)extension | 165 - (id)initWithExtension:(const Extension*)extension |
165 profile:(Profile*)profile | 166 profile:(Profile*)profile |
166 extensionAction:(ExtensionAction*)action{ | 167 extensionAction:(ExtensionAction*)action{ |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 328 } |
328 return YES; | 329 return YES; |
329 } | 330 } |
330 | 331 |
331 - (void)invalidateProfile { | 332 - (void)invalidateProfile { |
332 observer_.reset(); | 333 observer_.reset(); |
333 profile_ = NULL; | 334 profile_ = NULL; |
334 } | 335 } |
335 | 336 |
336 @end | 337 @end |
OLD | NEW |