| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 case kExtensionContextOptions: { | 255 case kExtensionContextOptions: { |
| 256 DCHECK(!extension_->options_url().is_empty()); | 256 DCHECK(!extension_->options_url().is_empty()); |
| 257 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension_, | 257 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension_, |
| 258 browser); | 258 browser); |
| 259 break; | 259 break; |
| 260 } | 260 } |
| 261 case kExtensionContextDisable: { | 261 case kExtensionContextDisable: { |
| 262 ExtensionService* extensionService = profile_->GetExtensionService(); | 262 ExtensionService* extensionService = profile_->GetExtensionService(); |
| 263 if (!extensionService) | 263 if (!extensionService) |
| 264 return; // Incognito mode. | 264 return; // Incognito mode. |
| 265 extensionService->DisableExtension(extension_->id()); | 265 extensionService->DisableExtension(extension_->id(), |
| 266 Extension::DISABLE_USER_ACTION); |
| 266 break; | 267 break; |
| 267 } | 268 } |
| 268 case kExtensionContextUninstall: { | 269 case kExtensionContextUninstall: { |
| 269 uninstaller_.reset(new AsyncUninstaller(extension_, profile_)); | 270 uninstaller_.reset(new AsyncUninstaller(extension_, profile_)); |
| 270 break; | 271 break; |
| 271 } | 272 } |
| 272 case kExtensionContextHide: { | 273 case kExtensionContextHide: { |
| 273 ExtensionService* extension_service = profile_->GetExtensionService(); | 274 ExtensionService* extension_service = profile_->GetExtensionService(); |
| 274 extension_service->SetBrowserActionVisibility(extension_, false); | 275 extension_service->SetBrowserActionVisibility(extension_, false); |
| 275 break; | 276 break; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 } | 326 } |
| 326 return YES; | 327 return YES; |
| 327 } | 328 } |
| 328 | 329 |
| 329 - (void)invalidateProfile { | 330 - (void)invalidateProfile { |
| 330 observer_.reset(); | 331 observer_.reset(); |
| 331 profile_ = NULL; | 332 profile_ = NULL; |
| 332 } | 333 } |
| 333 | 334 |
| 334 @end | 335 @end |
| OLD | NEW |