blob: 4ef437c4ab605e87bb360c8c9ea1fdb4e2bae1cd [file] [log] [blame]
// Copyright 2018 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 "chrome/browser/resource_coordinator/lifecycle_unit_state.mojom.h"
#include "content/public/browser/visibility.h"
namespace resource_coordinator {
using ::mojom::LifecycleUnitState;
using ::mojom::LifecycleUnitStateChangeReason;
class LifecycleUnit;
// Interface to be notified when the state of a LifecycleUnit changes.
class LifecycleUnitObserver {
virtual ~LifecycleUnitObserver();
// Invoked when the state of the observed LifecycleUnit changes.
virtual void OnLifecycleUnitStateChanged(
LifecycleUnit* lifecycle_unit,
LifecycleUnitState last_state,
LifecycleUnitStateChangeReason reason);
// Invoked when the visibility of the observed LifecyleUnit changes.
virtual void OnLifecycleUnitVisibilityChanged(LifecycleUnit* lifecycle_unit,
content::Visibility visibility);
// Invoked before the observed LifecycleUnit starts being destroyed (i.e.
// |lifecycle_unit| is still valid when this is invoked).
virtual void OnLifecycleUnitDestroyed(LifecycleUnit* lifecycle_unit);
} // namespace resource_coordinator