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

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, 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..a8b43d6cd0cfba0627b7ba186ee5d7c114463078 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.
};
@@ -898,11 +906,14 @@ void RenderViewContextMenu::AppendLinkItems() {
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD,
IDS_CONTENT_CONTEXT_OPENLINKOFFTHERECORD);
+#if defined(OS_CHROMEOS)
+ AppendArcLinkItems();
+#else
// While ChromeOS supports multiple profiles, only one can be open at a
// time.
// TODO(jochen): Consider adding support for ChromeOS with similar
// semantics as the profile switcher in the system tray.
-#if !defined(OS_CHROMEOS)
+
// g_browser_process->profile_manager() is null during unit tests.
if (g_browser_process->profile_manager() &&
GetProfile()->GetProfileType() == Profile::REGULAR_PROFILE) {
@@ -961,7 +972,7 @@ void RenderViewContextMenu::AppendLinkItems() {
&profile_link_submenu_model_);
}
}
-#endif // !defined(OS_CHROMEOS)
+#endif // defined(OS_CHROMEOS)
menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_SAVELINKAS,
IDS_CONTENT_CONTEXT_SAVELINKAS);
@@ -981,6 +992,15 @@ void RenderViewContextMenu::AppendLinkItems() {
}
}
+#if defined(OS_CHROMEOS)
+void RenderViewContextMenu::AppendArcLinkItems() {
+ if (!arc_app_menu_observer_.get())
dcheng 2016/03/05 05:06:17 Nit: no .get()
Yusuke Sato 2016/03/05 20:49:51 Done.
+ 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