Commit 9e9427d3 authored by Eric Noyau's avatar Eric Noyau Committed by Commit Bot

Remove flag for Request Mobile Site.

First patch just removes the flag and the command line, the second removes all
the associated code.

Change-Id: Iad8fd182655dca68be28f00c8a55e200dd7557f8
Reviewed-on: https://chromium-review.googlesource.com/598234Reviewed-by: default avatarYuke Liao <liaoyuke@chromium.org>
Commit-Queue: Eric Noyau <noyau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491397}
parent c4bc207e
......@@ -292,11 +292,6 @@ void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
command_line->AppendSwitch(switches::kDisableBookmarkReordering);
}
// Populate command line flag for the request mobile site experiment from the
// configuration plist.
if ([defaults boolForKey:@"RequestMobileSiteDisabled"])
command_line->AppendSwitch(switches::kDisableRequestMobileSite);
// Populate command line flag for 3rd party keyboard omnibox workaround.
NSString* enableThirdPartyKeyboardWorkaround =
[defaults stringForKey:@"EnableThirdPartyKeyboardWorkaround"];
......
......@@ -44,9 +44,6 @@ const char kDisableTabStripAutoScrollNewTabs[] =
// Disables Physical Web scanning for nearby URLs.
const char kDisableIOSPhysicalWeb[] = "disable-ios-physical-web";
// Disables Request Mobile Site.
const char kDisableRequestMobileSite[] = "disable-request-mobile-site";
// Disables the Suggestions UI
const char kDisableSuggestionsUI[] = "disable-suggestions-ui";
......
......@@ -19,7 +19,6 @@ extern const char kDisableNTPFavicons[];
extern const char kDisableOfflineAutoReload[];
extern const char kDisableTabStripAutoScrollNewTabs[];
extern const char kDisableIOSPhysicalWeb[];
extern const char kDisableRequestMobileSite[];
extern const char kDisableSuggestionsUI[];
extern const char kDisableBookmarkReordering[];
extern const char kDisableSlimNavigationManager[];
......
......@@ -69,9 +69,6 @@ bool IsPhysicalWebEnabled();
// Whether reader mode is enabled.
bool IsReaderModeEnabled();
// Whether request mobile site is enabled.
bool IsRequestMobileSiteEnabled();
// Whether the Sign In Flow via SFSafariViewController is enabled.
bool IsSafariVCSignInEnabled();
......
......@@ -189,11 +189,6 @@ bool IsReaderModeEnabled() {
switches::kEnableReaderModeToolbarIcon);
}
bool IsRequestMobileSiteEnabled() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
return !command_line->HasSwitch(switches::kDisableRequestMobileSite);
}
bool IsSafariVCSignInEnabled() {
return ![[NSUserDefaults standardUserDefaults]
boolForKey:kSafariVCSignInDisabled];
......
......@@ -26,22 +26,6 @@
<string>Disabled</string>
</array>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Request Mobile Site</string>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Disable Request Mobile Site</string>
<key>Key</key>
<string>RequestMobileSiteDisabled</string>
<key>DefaultValue</key>
<false/>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
......
......@@ -155,10 +155,6 @@ class UserAgentResponseProvider : public web::DataResponseProvider {
// Tests that requesting mobile site of a page works and the user agent
// propagates to the next navigations in the same tab.
- (void)testRequestMobileSitePropagatesToNextNavigations {
if (!experimental_flags::IsRequestMobileSiteEnabled()) {
EARL_GREY_TEST_SKIPPED(@"Only enabled Request Mobile Site.");
}
std::unique_ptr<web::DataResponseProvider> provider(
new UserAgentResponseProvider());
web::test::SetUpHttpServer(std::move(provider));
......@@ -187,10 +183,6 @@ class UserAgentResponseProvider : public web::DataResponseProvider {
// Tests that requesting mobile site of a page works and going back re-opens
// desktop version of the page.
- (void)testRequestMobileSiteGoBackToDesktop {
if (!experimental_flags::IsRequestMobileSiteEnabled()) {
EARL_GREY_TEST_SKIPPED(@"Only enabled Request Mobile Site.");
}
std::unique_ptr<web::DataResponseProvider> provider(
new UserAgentResponseProvider());
web::test::SetUpHttpServer(std::move(provider));
......@@ -257,10 +249,6 @@ class UserAgentResponseProvider : public web::DataResponseProvider {
// Tests that navigator.appVersion JavaScript API returns correct string for
// mobile User Agent.
- (void)testAppVersionJSAPIWithMobileUserAgent {
if (!experimental_flags::IsRequestMobileSiteEnabled()) {
EARL_GREY_TEST_SKIPPED(@"Only enabled Request Mobile Site.");
}
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kUserAgentTestURL)];
// Verify initial reception of the mobile site.
......
......@@ -113,15 +113,9 @@ bool ToolsMenuItemShouldBeVisible(const MenuItemInfo& item,
->GetUserFeedbackProvider()
->IsUserFeedbackEnabled();
case IDS_IOS_TOOLS_MENU_REQUEST_DESKTOP_SITE:
if (experimental_flags::IsRequestMobileSiteEnabled())
return (configuration.userAgentType != web::UserAgentType::DESKTOP);
else
return true;
return (configuration.userAgentType != web::UserAgentType::DESKTOP);
case IDS_IOS_TOOLS_MENU_REQUEST_MOBILE_SITE:
if (experimental_flags::IsRequestMobileSiteEnabled())
return (configuration.userAgentType == web::UserAgentType::DESKTOP);
else
return false;
return (configuration.userAgentType == web::UserAgentType::DESKTOP);
default:
return true;
}
......
......@@ -294,12 +294,6 @@ NS_INLINE void AnimateInViews(NSArray* views,
break;
case web::UserAgentType::DESKTOP:
[self setItemEnabled:YES withTag:IDC_REQUEST_MOBILE_SITE];
if (!experimental_flags::IsRequestMobileSiteEnabled()) {
// When Request Mobile Site is disabled, the enabled state of Request
// Desktop Site button needs to be set to NO because it is visible even
// though the current UserAgentType is DESKTOP.
[self setItemEnabled:NO withTag:IDC_REQUEST_DESKTOP_SITE];
}
break;
}
......
......@@ -84,13 +84,7 @@ TEST_F(ToolsMenuViewControllerTest, TestUserAgentTypeDESKTOP) {
ToolsMenuViewItem* mobile_item =
GetToolsMenuViewItemWithTag(IDC_REQUEST_MOBILE_SITE);
if (experimental_flags::IsRequestMobileSiteEnabled()) {
EXPECT_FALSE(desktop_item);
ASSERT_TRUE(mobile_item);
EXPECT_TRUE(mobile_item.active);
} else {
ASSERT_TRUE(desktop_item);
EXPECT_FALSE(desktop_item.active);
EXPECT_FALSE(mobile_item);
}
EXPECT_FALSE(desktop_item);
ASSERT_TRUE(mobile_item);
EXPECT_TRUE(mobile_item.active);
}
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