| 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 #include "chrome/browser/extensions/extension_context_menu_model.h" | 5 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_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/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension, | 128 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension, |
| 129 browser_); | 129 browser_); |
| 130 break; | 130 break; |
| 131 case HIDE: { | 131 case HIDE: { |
| 132 ExtensionService* extension_service = profile_->GetExtensionService(); | 132 ExtensionService* extension_service = profile_->GetExtensionService(); |
| 133 extension_service->SetBrowserActionVisibility(extension, false); | 133 extension_service->SetBrowserActionVisibility(extension, false); |
| 134 break; | 134 break; |
| 135 } | 135 } |
| 136 case DISABLE: { | 136 case DISABLE: { |
| 137 ExtensionService* extension_service = profile_->GetExtensionService(); | 137 ExtensionService* extension_service = profile_->GetExtensionService(); |
| 138 extension_service->DisableExtension(extension_id_); | 138 extension_service->DisableExtension(extension_id_, |
| 139 Extension::DISABLE_USER_ACTION); |
| 139 break; | 140 break; |
| 140 } | 141 } |
| 141 case UNINSTALL: { | 142 case UNINSTALL: { |
| 142 AddRef(); // Balanced in Accepted() and Canceled() | 143 AddRef(); // Balanced in Accepted() and Canceled() |
| 143 extension_uninstall_dialog_.reset( | 144 extension_uninstall_dialog_.reset( |
| 144 ExtensionUninstallDialog::Create(profile_, this)); | 145 ExtensionUninstallDialog::Create(profile_, this)); |
| 145 extension_uninstall_dialog_->ConfirmUninstall(extension); | 146 extension_uninstall_dialog_->ConfirmUninstall(extension); |
| 146 break; | 147 break; |
| 147 } | 148 } |
| 148 case MANAGE: { | 149 case MANAGE: { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 168 } | 169 } |
| 169 | 170 |
| 170 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { | 171 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { |
| 171 Release(); | 172 Release(); |
| 172 } | 173 } |
| 173 | 174 |
| 174 const Extension* ExtensionContextMenuModel::GetExtension() const { | 175 const Extension* ExtensionContextMenuModel::GetExtension() const { |
| 175 ExtensionService* extension_service = profile_->GetExtensionService(); | 176 ExtensionService* extension_service = profile_->GetExtensionService(); |
| 176 return extension_service->GetExtensionById(extension_id_, false); | 177 return extension_service->GetExtensionById(extension_id_, false); |
| 177 } | 178 } |
| OLD | NEW |