Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(731)

Unified Diff: chrome/browser/extensions/menu_manager.cc

Issue 10832348: Tab value for context menu onclick event should be optional. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update the test code to chrome.app.runtime instead of experimental Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/menu_manager.cc
diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc
index 7f4d3250282b31aaa96459c8b56e6e2f40184b3c..9e29835393017c08436e27a6680804e6c361bcb9 100644
--- a/chrome/browser/extensions/menu_manager.cc
+++ b/chrome/browser/extensions/menu_manager.cc
@@ -640,11 +640,14 @@ void MenuManager::ExecuteCommand(Profile* profile,
args->Append(properties);
// Add the tab info to the argument list.
- // Note: web_contents only NULL in unit tests :(
- if (web_contents)
- args->Append(ExtensionTabUtil::CreateTabValue(web_contents));
- else
- args->Append(new DictionaryValue());
+ // No tab info in a platform app.
+ if (!extension || !extension->is_platform_app()) {
+ // Note: web_contents only NULL in unit tests :(
+ if (web_contents)
+ args->Append(ExtensionTabUtil::CreateTabValue(web_contents));
+ else
+ args->Append(new DictionaryValue());
+ }
if (item->type() == MenuItem::CHECKBOX ||
item->type() == MenuItem::RADIO) {
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698