Commit 2ec52056 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

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/1245381Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594261}
parent d05df500
......@@ -151,6 +151,9 @@
#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
......
......@@ -884,6 +884,8 @@ void BrowserCommandController::InitCommandState() {
}
#endif
UpdateShowSyncState(true);
// Navigation commands
command_updater_.UpdateCommandEnabled(
IDC_HOME,
......@@ -1161,6 +1163,7 @@ void BrowserCommandController::UpdateCommandsForFullscreenMode() {
#if defined(GOOGLE_CHROME_BUILD)
command_updater_.UpdateCommandEnabled(IDC_FEEDBACK, show_main_ui);
#endif
UpdateShowSyncState(show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui);
......@@ -1274,6 +1277,13 @@ void BrowserCommandController::UpdateSaveAsState() {
command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, CanSavePage(browser_));
}
void BrowserCommandController::UpdateShowSyncState(bool show_main_ui) {
if (is_locked_fullscreen_)
return;
command_updater_.UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, show_main_ui);
}
// static
void BrowserCommandController::UpdateOpenFileState(
CommandUpdater* command_updater) {
......
......@@ -341,7 +341,6 @@ 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,8 +369,6 @@ 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,
......@@ -473,7 +470,7 @@ TEST_F(BrowserCommandControllerTest, OptionsConsistency) {
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_OPTIONS));
}
TEST_F(BrowserCommandControllerTest, IncognitoModeShowSigninCommand) {
TEST_F(BrowserCommandControllerTest, IncognitoModeShowSyncSetupCommand) {
// Set up a profile with an off the record profile.
std::unique_ptr<TestingProfile> profile1 = TestingProfile::Builder().Build();
Profile* profile2 = profile1->GetOffTheRecordProfile();
......@@ -489,6 +486,6 @@ TEST_F(BrowserCommandControllerTest, IncognitoModeShowSigninCommand) {
chrome::BrowserCommandController command_controller(browser2.get());
const CommandUpdater* command_updater = &command_controller;
// Check that the IDC_SHOW_SIGNIN command is enabled in incognito.
EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SIGNIN));
// Check that the IDC_SHOW_SYNC_SETUP command is enabled in incognito.
EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
}
......@@ -534,7 +534,7 @@ void AppMenuModel::LogMenuMetrics(int command_id) {
}
LogMenuAction(MENU_ACTION_SHOW_DOWNLOADS);
break;
case IDC_SHOW_SIGNIN:
case IDC_SHOW_SYNC_SETUP:
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