Index: chrome/browser/tab_contents/render_view_context_menu.cc |
=================================================================== |
--- chrome/browser/tab_contents/render_view_context_menu.cc (revision 79632) |
+++ chrome/browser/tab_contents/render_view_context_menu.cc (working copy) |
@@ -36,6 +36,7 @@ |
#include "chrome/browser/search_engines/template_url_model.h" |
#include "chrome/browser/spellcheck_host.h" |
#include "chrome/browser/spellchecker_platform_engine.h" |
+#include "chrome/browser/tab_contents/introducer_handler.h" |
#include "chrome/browser/translate/translate_prefs.h" |
#include "chrome/browser/translate/translate_manager.h" |
#include "chrome/common/chrome_constants.h" |
@@ -457,6 +458,11 @@ |
return; |
} |
+ if (IntroducerService::InitMenu(source_tab_contents_, profile_, params_, |
+ &introducer_commands_, &menu_model_)) { |
+ return; |
+ } |
+ |
// When no special node or text is selected and selection has no link, |
// show page items. |
bool is_devtools = false; |
@@ -869,6 +875,12 @@ |
return true; |
} |
+ // Introducer items. |
+ if (id >= IDC_INTRODUCER_CONTEXT_CUSTOM_FIRST && |
+ id <= IDC_INTRODUCER_CONTEXT_CUSTOM_LAST) { |
+ return true; |
+ } |
+ |
switch (id) { |
case IDC_BACK: |
return source_tab_contents_->controller().CanGoBack(); |
@@ -1104,6 +1116,12 @@ |
return false; |
} |
+ // Introducer items. |
+ if (id >= IDC_INTRODUCER_CONTEXT_CUSTOM_FIRST && |
+ id <= IDC_INTRODUCER_CONTEXT_CUSTOM_LAST) { |
+ return false; |
+ } |
+ |
#if defined(OS_MACOSX) |
if (id == IDC_WRITING_DIRECTION_DEFAULT) |
return params_.writing_direction_default & |
@@ -1174,6 +1192,15 @@ |
return; |
} |
+ // Process Introducer menu items. |
+ if (id >= IDC_INTRODUCER_CONTEXT_CUSTOM_FIRST && |
+ id <= IDC_INTRODUCER_CONTEXT_CUSTOM_LAST) { |
+ if (IntroducerService::Introduce(source_tab_contents_, profile_, params_, |
+ introducer_commands_[id])) { |
+ params_.introduction_context.request_id = 0; |
+ } |
+ return; |
+ } |
switch (id) { |
case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: |
@@ -1470,6 +1497,10 @@ |
void RenderViewContextMenu::MenuClosed() { |
source_tab_contents_->render_view_host()->ContextMenuClosed( |
params_.custom_context); |
+ if (params_.introduction_context.request_id) { |
+ IntroducerService::Dismiss(source_tab_contents_, |
+ params_.introduction_context.request_id); |
+ } |
} |
bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { |