Commit 4940014d authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Remove Email Page Location browser command

On Mac, this was replaced by the email share service in the share menu.
It doesn't appear to have ever been hooked up on other platforms.

Bug: 1098822
Change-Id: Ibb3c30c0c32d98e7c46f04e80e01c05e145b5ea3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264583Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782676}
parent 6b3af2a5
...@@ -537,9 +537,6 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( ...@@ -537,9 +537,6 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
->GetMainFrame() ->GetMainFrame()
->ViewSource(); ->ViewSource();
break; break;
case IDC_EMAIL_PAGE_LOCATION:
EmailPageLocation(browser_);
break;
case IDC_PRINT: case IDC_PRINT:
Print(browser_); Print(browser_);
break; break;
...@@ -974,7 +971,6 @@ void BrowserCommandController::InitCommandState() { ...@@ -974,7 +971,6 @@ void BrowserCommandController::InitCommandState() {
command_updater_.UpdateCommandEnabled(IDC_OPEN_IN_PWA_WINDOW, true); command_updater_.UpdateCommandEnabled(IDC_OPEN_IN_PWA_WINDOW, true);
// Page-related commands // Page-related commands
command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true);
command_updater_.UpdateCommandEnabled(IDC_MANAGE_PASSWORDS_FOR_PAGE, true); command_updater_.UpdateCommandEnabled(IDC_MANAGE_PASSWORDS_FOR_PAGE, true);
// Zoom // Zoom
...@@ -1165,8 +1161,6 @@ void BrowserCommandController::UpdateCommandsForTabState() { ...@@ -1165,8 +1161,6 @@ void BrowserCommandController::UpdateCommandsForTabState() {
window()->ZoomChangedForActiveTab(false); window()->ZoomChangedForActiveTab(false);
command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE,
CanViewSource(browser_)); CanViewSource(browser_));
command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION,
CanEmailPageLocation(browser_));
if (browser_->is_type_devtools()) if (browser_->is_type_devtools())
command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false);
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "chrome/browser/media/router/media_router_dialog_controller.h" // nogncheck #include "chrome/browser/media/router/media_router_dialog_controller.h" // nogncheck
#include "chrome/browser/media/router/media_router_feature.h" #include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/media/router/media_router_metrics.h" #include "chrome/browser/media/router/media_router_metrics.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_service_factory.h" #include "chrome/browser/sessions/session_service_factory.h"
...@@ -1205,27 +1204,6 @@ void RouteMediaInvokedFromAppMenu(Browser* browser) { ...@@ -1205,27 +1204,6 @@ void RouteMediaInvokedFromAppMenu(Browser* browser) {
media_router::MediaRouterDialogOpenOrigin::APP_MENU); media_router::MediaRouterDialogOpenOrigin::APP_MENU);
} }
void EmailPageLocation(Browser* browser) {
base::RecordAction(UserMetricsAction("EmailPageLocation"));
WebContents* wc = browser->tab_strip_model()->GetActiveWebContents();
DCHECK(wc);
std::string title =
net::EscapeQueryParamValue(base::UTF16ToUTF8(wc->GetTitle()), false);
std::string page_url = net::EscapeQueryParamValue(wc->GetURL().spec(), false);
std::string mailto = std::string("mailto:?subject=Fwd:%20") + title +
"&body=%0A%0A" + page_url;
platform_util::OpenExternal(browser->profile(), GURL(mailto));
}
bool CanEmailPageLocation(const Browser* browser) {
return browser->location_bar_model()->ShouldDisplayURL() &&
browser->tab_strip_model()
->GetActiveWebContents()
->GetURL()
.is_valid();
}
void CutCopyPaste(Browser* browser, int command_id) { void CutCopyPaste(Browser* browser, int command_id) {
if (command_id == IDC_CUT) if (command_id == IDC_CUT)
base::RecordAction(UserMetricsAction("Cut")); base::RecordAction(UserMetricsAction("Cut"));
......
...@@ -161,8 +161,6 @@ bool CanRouteMedia(Browser* browser); ...@@ -161,8 +161,6 @@ bool CanRouteMedia(Browser* browser);
// from the app menu. That will need to be changed if this is to be invoked from // from the app menu. That will need to be changed if this is to be invoked from
// elsewhere. // elsewhere.
void RouteMediaInvokedFromAppMenu(Browser* browser); void RouteMediaInvokedFromAppMenu(Browser* browser);
void EmailPageLocation(Browser* browser);
bool CanEmailPageLocation(const Browser* browser);
void CutCopyPaste(Browser* browser, int command_id); void CutCopyPaste(Browser* browser, int command_id);
void Find(Browser* browser); void Find(Browser* browser);
void FindNext(Browser* browser); void FindNext(Browser* browser);
......
...@@ -6162,6 +6162,10 @@ should be able to be added at any place in this file. ...@@ -6162,6 +6162,10 @@ should be able to be added at any place in this file.
</action> </action>
<action name="EmailPageLocation"> <action name="EmailPageLocation">
<obsolete>
Functionality was rolled into Share on Mac. Doesn't appear to have been used
on other platforms.
</obsolete>
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description> <description>Please enter the description of this user action.</description>
</action> </action>
......
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