| 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/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_tab_util.h" | 9 #include "chrome/browser/extensions/extension_tab_util.h" |
| 10 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 10 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 extensionService->DisableExtension(extension_->id(), | 179 extensionService->DisableExtension(extension_->id(), |
| 180 Extension::DISABLE_USER_ACTION); | 180 Extension::DISABLE_USER_ACTION); |
| 181 break; | 181 break; |
| 182 } | 182 } |
| 183 case kExtensionContextUninstall: { | 183 case kExtensionContextUninstall: { |
| 184 uninstaller_.reset(new AsyncUninstaller(extension_, profile_)); | 184 uninstaller_.reset(new AsyncUninstaller(extension_, profile_)); |
| 185 break; | 185 break; |
| 186 } | 186 } |
| 187 case kExtensionContextHide: { | 187 case kExtensionContextHide: { |
| 188 ExtensionService* extension_service = profile_->GetExtensionService(); | 188 ExtensionService* extension_service = profile_->GetExtensionService(); |
| 189 extension_service->SetBrowserActionVisibility(extension_, false); | 189 extension_service->extension_prefs()-> |
| 190 SetBrowserActionVisibility(extension_, false); |
| 190 break; | 191 break; |
| 191 } | 192 } |
| 192 case kExtensionContextManage: { | 193 case kExtensionContextManage: { |
| 193 browser->ShowExtensionsTab(); | 194 browser->ShowExtensionsTab(); |
| 194 break; | 195 break; |
| 195 } | 196 } |
| 196 default: | 197 default: |
| 197 NOTREACHED(); | 198 NOTREACHED(); |
| 198 break; | 199 break; |
| 199 } | 200 } |
| 200 } | 201 } |
| 201 | 202 |
| 202 - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { | 203 - (BOOL)validateMenuItem:(NSMenuItem*)menuItem { |
| 203 if ([menuItem tag] == kExtensionContextOptions) { | 204 if ([menuItem tag] == kExtensionContextOptions) { |
| 204 // Disable 'Options' if there are no options to set. | 205 // Disable 'Options' if there are no options to set. |
| 205 return extension_->options_url().spec().length() > 0; | 206 return extension_->options_url().spec().length() > 0; |
| 206 } | 207 } |
| 207 return YES; | 208 return YES; |
| 208 } | 209 } |
| 209 | 210 |
| 210 @end | 211 @end |
| OLD | NEW |