| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
| 10 #include "chrome/browser/extensions/extension_action.h" | 10 #include "chrome/browser/extensions/extension_action.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 break; | 137 break; |
| 138 } | 138 } |
| 139 default: | 139 default: |
| 140 NOTREACHED() << "Unknown option"; | 140 NOTREACHED() << "Unknown option"; |
| 141 break; | 141 break; |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 void ExtensionContextMenuModel::ExtensionUninstallAccepted() { | 145 void ExtensionContextMenuModel::ExtensionUninstallAccepted() { |
| 146 if (GetExtension()) { | 146 if (GetExtension()) { |
| 147 extensions::ExtensionSystem::Get(profile_) | 147 extensions::ExtensionSystem::Get(profile_)->extension_service()-> |
| 148 ->extension_service() | 148 UninstallExtension(extension_id_, false, NULL); |
| 149 ->UninstallExtension(extension_id_, | |
| 150 ExtensionService::UNINSTALL_REASON_USER_INITIATED, | |
| 151 NULL); | |
| 152 } | 149 } |
| 153 Release(); | 150 Release(); |
| 154 } | 151 } |
| 155 | 152 |
| 156 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { | 153 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { |
| 157 Release(); | 154 Release(); |
| 158 } | 155 } |
| 159 | 156 |
| 160 ExtensionContextMenuModel::~ExtensionContextMenuModel() {} | 157 ExtensionContextMenuModel::~ExtensionContextMenuModel() {} |
| 161 | 158 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 180 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); | 177 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); |
| 181 AddSeparator(ui::NORMAL_SEPARATOR); | 178 AddSeparator(ui::NORMAL_SEPARATOR); |
| 182 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION); | 179 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION); |
| 183 } | 180 } |
| 184 | 181 |
| 185 const Extension* ExtensionContextMenuModel::GetExtension() const { | 182 const Extension* ExtensionContextMenuModel::GetExtension() const { |
| 186 ExtensionService* extension_service = | 183 ExtensionService* extension_service = |
| 187 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 184 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
| 188 return extension_service->GetExtensionById(extension_id_, false); | 185 return extension_service->GetExtensionById(extension_id_, false); |
| 189 } | 186 } |
| OLD | NEW |