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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 6880275: Web Introducer overview Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 8 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 | « chrome/browser/tab_contents/render_view_context_menu.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698