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

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 dcheng's comment 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
« no previous file with comments | « chrome/browser/renderer_context_menu/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/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 fb8c8621df3350de646ecb6b3d0824ac728883b8..1ad2379e95ebdda9eab9e7eab884e7fc323efaf1 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -47,6 +47,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"
@@ -291,9 +292,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.
};
@@ -945,6 +960,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
@@ -1040,6 +1057,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());
« no previous file with comments | « chrome/browser/renderer_context_menu/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