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

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

Issue 1760773004: Add "Open with <ARC-app-name>" items to the context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 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
Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 89bf0a7c24c51134139a46e6bd0603007760113c..a177d35a3ab7c9f76f47721fb6497ee991b1d2b8 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -46,6 +46,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/renderer_context_menu/context_menu_content_type_factory.h"
+#include "chrome/browser/renderer_context_menu/open_with_menu_factory.h"
#include "chrome/browser/renderer_context_menu/spelling_menu_observer.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -290,9 +291,23 @@ const struct UmaEnumCommandIdPair {
{71, -1, IDC_OPEN_LINK_IN_PROFILE_FIRST},
{72, -1, IDC_CONTENT_CONTEXT_GENERATEPASSWORD},
{73, -1, IDC_SPELLCHECK_MULTI_LINGUAL},
+ {74, -1, IDC_CONTENT_CONTEXT_OPEN_WITH1},
+ {75, -1, IDC_CONTENT_CONTEXT_OPEN_WITH2},
+ {76, -1, IDC_CONTENT_CONTEXT_OPEN_WITH3},
+ {77, -1, IDC_CONTENT_CONTEXT_OPEN_WITH4},
+ {78, -1, IDC_CONTENT_CONTEXT_OPEN_WITH5},
+ {79, -1, IDC_CONTENT_CONTEXT_OPEN_WITH6},
+ {80, -1, IDC_CONTENT_CONTEXT_OPEN_WITH7},
+ {81, -1, IDC_CONTENT_CONTEXT_OPEN_WITH8},
+ {82, -1, IDC_CONTENT_CONTEXT_OPEN_WITH9},
+ {83, -1, IDC_CONTENT_CONTEXT_OPEN_WITH10},
+ {84, -1, IDC_CONTENT_CONTEXT_OPEN_WITH11},
+ {85, -1, IDC_CONTENT_CONTEXT_OPEN_WITH12},
+ {86, -1, IDC_CONTENT_CONTEXT_OPEN_WITH13},
+ {87, -1, IDC_CONTENT_CONTEXT_OPEN_WITH14},
// Add new items here and use |enum_id| from the next line.
// Also, add new items to RenderViewContextMenuItem enum in histograms.xml.
- {74, -1, 0}, // Must be the last. Increment |enum_id| when new IDC
+ {88, -1, 0}, // Must be the last. Increment |enum_id| when new IDC
// was added.
};
@@ -942,6 +957,8 @@ void RenderViewContextMenu::AppendLinkItems() {
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD,
IDS_CONTENT_CONTEXT_OPENLINKOFFTHERECORD);
+ AppendOpenWithLinkItems();
+
// While ChromeOS supports multiple profiles, only one can be open at a
// time.
// TODO(jochen): Consider adding support for ChromeOS with similar
@@ -1037,6 +1054,14 @@ void RenderViewContextMenu::AppendLinkItems() {
}
}
+void RenderViewContextMenu::AppendOpenWithLinkItems() {
+ open_with_menu_observer_.reset(OpenWithMenuFactory::CreateMenu(this));
+ if (open_with_menu_observer_) {
+ observers_.AddObserver(open_with_menu_observer_.get());
+ open_with_menu_observer_->InitMenu(params_);
+ }
+}
+
void RenderViewContextMenu::AppendImageItems() {
std::map<std::string, std::string>::const_iterator it =
params_.properties.find(data_reduction_proxy::chrome_proxy_header());

Powered by Google App Engine
This is Rietveld 408576698