Commit 290bc882 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

Reland "Remove IDC_SHOW_SYNC_SETUP"

This reverts commit 2ec52056.

Reason for revert: This original CL was reverted as in emergency for M70 as it was in the CL dependency chain for the signin allowed pref CL.

Original change's description:
> Revert "Remove IDC_SHOW_SYNC_SETUP"
> 
> This reverts commit eafee2dc.
> 
> Reason for revert: Still needed for http://crbug.com/888776
> 
> Original change's description:
> > Remove IDC_SHOW_SYNC_SETUP
> > 
> > IDC_SHOW_SYNC_SETUP and IDC_SHOW_SIGNIN have the same integer value. This
> > CL removes IDC_SHOW_SYNC_SETUP to avoid confusion. It also cleans up
> > the code in browser_command_controller that was setting both IDC_SHOW_SYNC_SETUP
> > and IDC_SHOW_SIGNIN without knowing that they are in fact the same thing.
> > 
> > Bug: 870239
> > Change-Id: I3b1ac005d3230fc581e6163a53ad20a84d124402
> > Reviewed-on: https://chromium-review.googlesource.com/1236263
> > Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
> > Reviewed-by: Scott Violet <sky@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#593138}
> 
> TBR=sky@chromium.org,msarda@chromium.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: 870239
> Change-Id: I50cd0042f2630dca0bafe4540c2c32411acf0338
> Reviewed-on: https://chromium-review.googlesource.com/1245381
> Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
> Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#594261}

TBR=sky@chromium.org,msarda@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 870239
Change-Id: Icde4e75988dd24b5bb2add35be055177708c7bfe
Reviewed-on: https://chromium-review.googlesource.com/c/1278745
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599168}
parent 830919ba
......@@ -151,9 +151,6 @@
#define IDC_SHOW_KEYBOARD_OVERLAY 40027
#define IDC_PROFILING_ENABLED 40028
#define IDC_BOOKMARKS_MENU 40029
// TODO(atwilson): Remove IDC_SHOW_SYNC_SETUP when we officially allow signin
// when sync is disabled.
#define IDC_SHOW_SYNC_SETUP 40030
#define IDC_SHOW_SIGNIN 40030
#define IDC_EXTENSION_ERRORS 40031
#define IDC_SHOW_SIGNIN_ERROR 40032
......
......@@ -1297,7 +1297,7 @@ void BrowserCommandController::UpdateShowSyncState(bool show_main_ui) {
return;
command_updater_.UpdateCommandEnabled(
IDC_SHOW_SYNC_SETUP, show_main_ui && pref_signin_allowed_.GetValue());
IDC_SHOW_SIGNIN, show_main_ui && pref_signin_allowed_.GetValue());
}
// static
......
......@@ -342,6 +342,7 @@ TEST_F(BrowserCommandControllerFullscreenTest,
// Command ID | tab mode | fullscreen |
// | enabled | reserved | enabled | reserved |
// clang-format off
{ IDC_OPEN_CURRENT_URL, true, false, false, false },
{ IDC_FOCUS_TOOLBAR, true, false, false, false },
{ IDC_FOCUS_LOCATION, true, false, false, false },
......@@ -370,6 +371,8 @@ TEST_F(BrowserCommandControllerFullscreenTest,
{ IDC_SELECT_PREVIOUS_TAB, true, true, true, false },
{ IDC_EXIT, true, true, true, true },
{ IDC_SHOW_AS_TAB, false, false, false, false },
{ IDC_SHOW_SIGNIN, true, false, true, false },
// clang-format on
};
const content::NativeWebKeyboardEvent key_event(
blink::WebInputEvent::kTypeFirst, 0,
......@@ -488,9 +491,9 @@ TEST_F(BrowserCommandControllerTest, IncognitoModeOnSigninAllowedPrefChange) {
const CommandUpdater* command_updater = &command_controller;
// Check that the SYNC_SETUP command is updated on preference change.
EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SIGNIN));
profile1->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false);
EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SIGNIN));
}
TEST_F(BrowserCommandControllerTest, OnSigninAllowedPrefChange) {
......@@ -498,7 +501,7 @@ TEST_F(BrowserCommandControllerTest, OnSigninAllowedPrefChange) {
const CommandUpdater* command_updater = &command_controller;
// Check that the SYNC_SETUP command is updated on preference change.
EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SIGNIN));
profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false);
EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SIGNIN));
}
......@@ -534,7 +534,7 @@ void AppMenuModel::LogMenuMetrics(int command_id) {
}
LogMenuAction(MENU_ACTION_SHOW_DOWNLOADS);
break;
case IDC_SHOW_SYNC_SETUP:
case IDC_SHOW_SIGNIN:
if (!uma_action_recorded_) {
UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ShowSyncSetup",
delta);
......
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