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

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: Created 4 years, 10 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 a1e4bc7bf9376a04ca8be4eacf359fa1196b61c6..2008836d32217b762c8368573ffa87f76e14fdf0 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -145,6 +145,10 @@
#include "chrome/browser/media/router/media_router_metrics.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/renderer_context_menu/arc_app_menu_observer_chromeos.h"
+#endif
+
using base::UserMetricsAction;
using blink::WebContextMenuData;
using blink::WebMediaPlayerAction;
@@ -278,9 +282,13 @@ 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_ARC_APP1},
+ {75, -1, IDC_CONTENT_CONTEXT_ARC_APP2},
+ {76, -1, IDC_CONTENT_CONTEXT_ARC_APP3},
+ {77, -1, IDC_CONTENT_CONTEXT_ARC_SUB_MENU},
// 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
+ {78, -1, 0}, // Must be the last. Increment |enum_id| when new IDC
// was added.
};
@@ -961,6 +969,8 @@ void RenderViewContextMenu::AppendLinkItems() {
&profile_link_submenu_model_);
}
}
+#else
+ AppendArcLinkItems();
#endif // !defined(OS_CHROMEOS)
menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_SAVELINKAS,
@@ -981,6 +991,15 @@ void RenderViewContextMenu::AppendLinkItems() {
}
}
+#if defined(OS_CHROMEOS)
+void RenderViewContextMenu::AppendArcLinkItems() {
+ if (!arc_app_menu_observer_.get())
+ arc_app_menu_observer_.reset(new ArcAppMenuObserver(this));
+ observers_.AddObserver(arc_app_menu_observer_.get());
+ arc_app_menu_observer_->InitMenu(params_);
+}
+#endif // defined(OS_CHROMEOS)
+
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