Commit cb7c961a authored by sheretov's avatar sheretov Committed by Commit bot
Browse files

[Media Router] Add a context menu item to access the chrome://cast page

The new menu item is titled "Manage Cast Devices".  It goes immediately below the second separator in the menu.

BUG=623048

Review-Url: https://codereview.chromium.org/2104463002
Cr-Commit-Position: refs/heads/master@{#402330}
parent 4159c800
......@@ -374,6 +374,7 @@
#if defined(GOOGLE_CHROME_BUILD)
#define IDC_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE 51205
#endif // defined(GOOGLE_CHROME_BUILD)
#define IDC_MEDIA_ROUTER_MANAGE_DEVICES 51206
// Context menu items for media stream status tray
#define IDC_MEDIA_STREAM_DEVICE_STATUS_TRAY 51300
......
......@@ -69,6 +69,9 @@
<message name="IDS_MEDIA_ROUTER_REPORT_ISSUE" desc="Title of a menu item which, on click, opens a page to give feedback or report an issue with Chromecast integration.">
Report an issue
</message>
<message name="IDS_MEDIA_ROUTER_MANAGE_DEVICES" desc="Title of a menu item which, on click, opens a page that allows the user to manage Cast devices: view, reboot, reset, and manage settings of available Cast devices, or set up new Cast devices.">
Manage Cast devices
</message>
<!-- First Run Flow -->
<if expr="_google_chrome">
......
......@@ -14,6 +14,7 @@
#include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h"
#include "chrome/browser/ui/toolbar/media_router_contextual_menu.h"
#include "chrome/browser/ui/toolbar/toolbar_actions_model.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "extensions/common/constants.h"
......@@ -42,6 +43,10 @@ MediaRouterContextualMenu::MediaRouterContextualMenu(Browser* browser)
menu_model_.AddItemWithStringId(IDC_MEDIA_ROUTER_REMOVE_TOOLBAR_ACTION,
IDS_EXTENSIONS_UNINSTALL);
menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
menu_model_.AddItemWithStringId(IDC_MEDIA_ROUTER_MANAGE_DEVICES,
IDS_MEDIA_ROUTER_MANAGE_DEVICES);
#endif
#if defined(GOOGLE_CHROME_BUILD)
menu_model_.AddCheckItemWithStringId(IDC_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE,
IDS_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE);
......@@ -126,6 +131,11 @@ void MediaRouterContextualMenu::ExecuteCommand(int command_id,
case IDC_MEDIA_ROUTER_LEARN_MORE:
chrome::ShowSingletonTab(browser_, GURL(kCastLearnMorePageUrl));
break;
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
case IDC_MEDIA_ROUTER_MANAGE_DEVICES:
chrome::ShowSingletonTab(browser_, GURL(chrome::kChromeUICastURL));
break;
#endif
case IDC_MEDIA_ROUTER_REMOVE_TOOLBAR_ACTION:
RemoveMediaRouterComponentAction();
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment