| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/extensions/active_script_controller.h" | 10 #include "chrome/browser/extensions/active_script_controller.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 void ExtensionContextMenuModel::ExecuteCommand(int command_id, | 235 void ExtensionContextMenuModel::ExecuteCommand(int command_id, |
| 236 int event_flags) { | 236 int event_flags) { |
| 237 const Extension* extension = GetExtension(); | 237 const Extension* extension = GetExtension(); |
| 238 if (!extension) | 238 if (!extension) |
| 239 return; | 239 return; |
| 240 | 240 |
| 241 if (command_id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST && | 241 if (command_id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST && |
| 242 command_id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) { | 242 command_id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) { |
| 243 DCHECK(extension_items_); | 243 DCHECK(extension_items_); |
| 244 extension_items_->ExecuteCommand(command_id, GetActiveWebContents(), | 244 extension_items_->ExecuteCommand(command_id, GetActiveWebContents(), |
| 245 content::ContextMenuParams()); | 245 nullptr, content::ContextMenuParams()); |
| 246 return; | 246 return; |
| 247 } | 247 } |
| 248 | 248 |
| 249 switch (command_id) { | 249 switch (command_id) { |
| 250 case NAME: { | 250 case NAME: { |
| 251 content::OpenURLParams params(ManifestURL::GetHomepageURL(extension), | 251 content::OpenURLParams params(ManifestURL::GetHomepageURL(extension), |
| 252 content::Referrer(), NEW_FOREGROUND_TAB, | 252 content::Referrer(), NEW_FOREGROUND_TAB, |
| 253 ui::PAGE_TRANSITION_LINK, false); | 253 ui::PAGE_TRANSITION_LINK, false); |
| 254 browser_->OpenURL(params); | 254 browser_->OpenURL(params); |
| 255 break; | 255 break; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 if (controller && controller->WantsToRun(extension)) | 457 if (controller && controller->WantsToRun(extension)) |
| 458 controller->OnClicked(extension); | 458 controller->OnClicked(extension); |
| 459 } | 459 } |
| 460 } | 460 } |
| 461 | 461 |
| 462 content::WebContents* ExtensionContextMenuModel::GetActiveWebContents() const { | 462 content::WebContents* ExtensionContextMenuModel::GetActiveWebContents() const { |
| 463 return browser_->tab_strip_model()->GetActiveWebContents(); | 463 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 464 } | 464 } |
| 465 | 465 |
| 466 } // namespace extensions | 466 } // namespace extensions |
| OLD | NEW |