1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_PUBLIC_ACTIVE_STATE_MANAGER_H_
6 #define IOS_WEB_PUBLIC_ACTIVE_STATE_MANAGER_H_
8 #include "base/macros.h"
14 // Manages the active state associated with a particular BrowserState. Not
15 // thread safe. Must be used only on the main thread.
16 class ActiveStateManager
{
18 // Sets the active state of the ActiveStateManager. At most one
19 // ActiveStateManager can be active at any given time in the app. A
20 // ActiveStateManager must be made inactive before it is destroyed. It is
21 // valid to call |SetActive(true)| on an already active ActiveStateManager.
22 virtual void SetActive(bool active
) = 0;
23 // Returns true if the BrowserState is active.
24 virtual bool IsActive() = 0;
27 virtual ~ActiveStateManager(){};
32 #endif // IOS_WEB_PUBLIC_ACTIVE_STATE_MANAGER_H_