| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 default: | 141 default: |
| 142 NOTREACHED() << "Unknown option"; | 142 NOTREACHED() << "Unknown option"; |
| 143 break; | 143 break; |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 void ExtensionContextMenuModel::ExtensionUninstallAccepted() { | 147 void ExtensionContextMenuModel::ExtensionUninstallAccepted() { |
| 148 if (GetExtension()) { | 148 if (GetExtension()) { |
| 149 extensions::ExtensionSystem::Get(profile_) | 149 extensions::ExtensionSystem::Get(profile_) |
| 150 ->extension_service() | 150 ->extension_service() |
| 151 ->UninstallExtension( | 151 ->UninstallExtension(extension_id_, |
| 152 extension_id_, extensions::UNINSTALL_REASON_USER_INITIATED, NULL); | 152 extensions::UNINSTALL_REASON_USER_INITIATED, |
| 153 base::Bind(&base::DoNothing), |
| 154 NULL); |
| 153 } | 155 } |
| 154 Release(); | 156 Release(); |
| 155 } | 157 } |
| 156 | 158 |
| 157 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { | 159 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { |
| 158 Release(); | 160 Release(); |
| 159 } | 161 } |
| 160 | 162 |
| 161 ExtensionContextMenuModel::~ExtensionContextMenuModel() {} | 163 ExtensionContextMenuModel::~ExtensionContextMenuModel() {} |
| 162 | 164 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 181 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); | 183 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); |
| 182 AddSeparator(ui::NORMAL_SEPARATOR); | 184 AddSeparator(ui::NORMAL_SEPARATOR); |
| 183 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION); | 185 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION); |
| 184 } | 186 } |
| 185 | 187 |
| 186 const Extension* ExtensionContextMenuModel::GetExtension() const { | 188 const Extension* ExtensionContextMenuModel::GetExtension() const { |
| 187 ExtensionService* extension_service = | 189 ExtensionService* extension_service = |
| 188 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 190 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
| 189 return extension_service->GetExtensionById(extension_id_, false); | 191 return extension_service->GetExtensionById(extension_id_, false); |
| 190 } | 192 } |
| OLD | NEW |