#include <vector>
#include "base/memory/singleton.h"
+#include "base/observer_list.h"
#include "ui/gl/gl_export.h"
#include "ui/gl/gpu_preference.h"
+#include "ui/gl/gpu_switching_observer.h"
#if defined(OS_MACOSX)
#include <OpenGL/OpenGL.h>
void SetGpuCount(size_t gpu_count);
+ void AddObserver(GpuSwitchingObserver* observer);
+ void RemoveObserver(GpuSwitchingObserver* observer);
+
+ // Called when a GPU switch is noticed by the system. In the browser process
+ // this is occurs as a result of a system observer. In the GPU process, this
+ // occurs as a result of an IPC from the browser. The system observer is kept
+ // in the browser process only so that any workarounds or blacklisting can
+ // be applied there.
+ void NotifyGpuSwitched();
+
private:
friend struct DefaultSingletonTraits<GpuSwitchingManager>;
size_t gpu_count_;
+ ObserverList<GpuSwitchingObserver> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager);
};