blob: 20d41bffd08a91d21a0a57285eb2f1d7588d500f [file] [log] [blame]
// Copyright 2017 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 IOS_CHROME_TEST_EARL_GREY_SCOPED_BLOCK_POPUPS_PREF_H_
#define IOS_CHROME_TEST_EARL_GREY_SCOPED_BLOCK_POPUPS_PREF_H_
#include "base/macros.h"
#include "components/content_settings/core/common/content_settings.h"
// ScopedBlockPopupsPref modifies the block popups preference for the original
// browser state and resets the preference to its original value when this
// object goes out of scope.
class ScopedBlockPopupsPref {
public:
explicit ScopedBlockPopupsPref(ContentSetting setting);
~ScopedBlockPopupsPref();
private:
// Saves the original pref setting so that it can be restored when the scoper
// is destroyed.
ContentSetting original_setting_;
DISALLOW_COPY_AND_ASSIGN(ScopedBlockPopupsPref);
};
#endif // IOS_CHROME_TEST_EARL_GREY_SCOPED_BLOCK_POPUPS_PREF_H_