Commit d869ab33 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Remove --disable-infobars.

This flag is no longer needed by the perf testing infrastructure and can be
misused for malicious purposes, so remove it.

BUG=none
TEST=none

Change-Id: Iaa875bc887a5a1564ca10ef7d3c2d760a1f7cb11
Reviewed-on: https://chromium-review.googlesource.com/857604Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Reviewed-by: default avatarEgor Pasko <pasko@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528386}
parent 30abaff3
......@@ -15,7 +15,6 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/infobars/core/infobar.h"
#include "components/infobars/core/infobars_switches.h"
#include "content/public/test/test_utils.h"
namespace {
......@@ -55,22 +54,6 @@ class GlobalConfirmInfoBarTest : public InProcessBrowserTest {
DISALLOW_COPY_AND_ASSIGN(GlobalConfirmInfoBarTest);
};
// Subclass for tests that require infobars to be disabled.
class GlobalConfirmInfoBarWithInfoBarDisabledTest
: public GlobalConfirmInfoBarTest {
public:
GlobalConfirmInfoBarWithInfoBarDisabledTest() = default;
~GlobalConfirmInfoBarWithInfoBarDisabledTest() override = default;
protected:
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitch(infobars::switches::kDisableInfoBars);
}
private:
DISALLOW_COPY_AND_ASSIGN(GlobalConfirmInfoBarWithInfoBarDisabledTest);
};
} // namespace
// Creates a global confirm info bar on a browser with 2 tabs and closes it.
......@@ -146,17 +129,3 @@ IN_PROC_BROWSER_TEST_F(GlobalConfirmInfoBarTest, UserInteraction) {
for (int i = 0; i < tab_strip_model->count(); i++)
EXPECT_EQ(0u, GetInfoBarServiceFromTabIndex(i)->infobar_count());
}
IN_PROC_BROWSER_TEST_F(GlobalConfirmInfoBarWithInfoBarDisabledTest,
InfoBarsDisabled) {
ASSERT_EQ(1, browser()->tab_strip_model()->count());
auto delegate = base::MakeUnique<TestConfirmInfoBarDelegate>();
base::WeakPtr<GlobalConfirmInfoBar> global_confirm_info_bar =
GlobalConfirmInfoBar::Show(std::move(delegate));
// In this case, the deletion is done asynchronously.
content::RunAllPendingInMessageLoop();
ASSERT_FALSE(global_confirm_info_bar);
}
......@@ -21,8 +21,6 @@ static_library("core") {
"infobar_delegate.h",
"infobar_manager.cc",
"infobar_manager.h",
"infobars_switches.cc",
"infobars_switches.h",
"simple_alert_infobar_delegate.cc",
"simple_alert_infobar_delegate.h",
]
......
......@@ -8,7 +8,6 @@
#include "base/command_line.h"
#include "components/infobars/core/infobar.h"
#include "components/infobars/core/infobars_switches.h"
namespace infobars {
......@@ -38,9 +37,6 @@ void InfoBarManager::Observer::OnManagerShuttingDown(InfoBarManager* manager) {
InfoBar* InfoBarManager::AddInfoBar(std::unique_ptr<InfoBar> infobar,
bool replace_existing) {
DCHECK(infobar);
if (!infobars_enabled_)
return nullptr;
for (InfoBars::const_iterator i(infobars_.begin()); i != infobars_.end();
++i) {
if ((*i)->delegate()->EqualsDelegate(infobar->delegate())) {
......@@ -71,8 +67,6 @@ void InfoBarManager::RemoveAllInfoBars(bool animate) {
InfoBar* InfoBarManager::ReplaceInfoBar(InfoBar* old_infobar,
std::unique_ptr<InfoBar> new_infobar) {
DCHECK(old_infobar);
if (!infobars_enabled_)
return AddInfoBar(std::move(new_infobar)); // Deletes the infobar.
DCHECK(new_infobar);
InfoBars::iterator i(std::find(infobars_.begin(), infobars_.end(),
......@@ -103,9 +97,6 @@ void InfoBarManager::RemoveObserver(Observer* obs) {
}
InfoBarManager::InfoBarManager() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableInfoBars))
infobars_enabled_ = false;
}
InfoBarManager::~InfoBarManager() {}
......@@ -142,11 +133,6 @@ void InfoBarManager::NotifyInfoBarRemoved(InfoBar* infobar, bool animate) {
void InfoBarManager::RemoveInfoBarInternal(InfoBar* infobar, bool animate) {
DCHECK(infobar);
if (!infobars_enabled_) {
DCHECK(infobars_.empty());
return;
}
InfoBars::iterator i(std::find(infobars_.begin(), infobars_.end(), infobar));
DCHECK(i != infobars_.end());
......
......@@ -132,7 +132,6 @@ class InfoBarManager {
void RemoveInfoBarInternal(InfoBar* infobar, bool animate);
InfoBars infobars_;
bool infobars_enabled_ = true;
bool animations_enabled_ = true;
base::ObserverList<Observer, true> observer_list_;
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/infobars/core/infobars_switches.h"
namespace infobars {
namespace switches {
// Prevent infobars from appearing.
const char kDisableInfoBars[] = "disable-infobars";
} // namespace switches
} // namespace infobars
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_INFOBARS_CORE_INFOBARS_SWITCHES_H_
#define COMPONENTS_INFOBARS_CORE_INFOBARS_SWITCHES_H_
namespace infobars {
namespace switches {
extern const char kDisableInfoBars[];
} // namespace switches
} // namespace infobars
#endif // COMPONENTS_INFOBARS_CORE_INFOBARS_SWITCHES_H_
......@@ -360,11 +360,6 @@ def _RemoteVideoRecorder(device, local_output_path, megabits_per_second):
def RemoteSpeedIndexRecorder(device, connection, local_output_path):
"""Records on a device a video compatible for speed-index computation.
Note:
Chrome should be opened with the --disable-infobars command line argument to
avoid web page viewport size to be changed, that can change speed-index
value.
Args:
device: (device_utils.DeviceUtils) Android device to connect to.
connection: devtools connection.
......
......@@ -331,7 +331,6 @@ class SandwichRunner(object):
self._chrome_ctl = controller.RemoteChromeController(self.android_device)
else:
self._chrome_ctl = controller.LocalChromeController()
self._chrome_ctl.AddChromeArguments(['--disable-infobars'])
self._chrome_ctl.AddChromeArguments(self.chrome_args)
if self.cache_operation == CacheOperation.SAVE:
self._chrome_ctl.SetSlowDeath()
......
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