#include "extensions/browser/app_window/app_window_geometry_cache.h"
#include <stdint.h>
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/json/values_util.h"
#include "base/not_fatal_until.h"
#include "base/observer_list.h"
#include "base/strings/string_number_conversions.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_prefs_factory.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_id.h"
namespace {
const int kSyncTimeoutMilliseconds = …;
}
namespace extensions {
AppWindowGeometryCache::AppWindowGeometryCache(content::BrowserContext* context,
ExtensionPrefs* prefs)
: … { … }
AppWindowGeometryCache::~AppWindowGeometryCache() = default;
AppWindowGeometryCache* AppWindowGeometryCache::Get(
content::BrowserContext* context) { … }
void AppWindowGeometryCache::SaveGeometry(const ExtensionId& extension_id,
const std::string& window_id,
const gfx::Rect& bounds,
const gfx::Rect& screen_bounds,
ui::WindowShowState window_state) { … }
void AppWindowGeometryCache::SyncToStorage() { … }
bool AppWindowGeometryCache::GetGeometry(const ExtensionId& extension_id,
const std::string& window_id,
gfx::Rect* bounds,
gfx::Rect* screen_bounds,
ui::WindowShowState* window_state) { … }
void AppWindowGeometryCache::Shutdown() { … }
AppWindowGeometryCache::WindowData::WindowData()
: … { … }
AppWindowGeometryCache::WindowData::~WindowData() = default;
void AppWindowGeometryCache::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) { … }
void AppWindowGeometryCache::OnExtensionUnloaded(
content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionReason reason) { … }
void AppWindowGeometryCache::SetSyncDelayForTests(int timeout_ms) { … }
void AppWindowGeometryCache::LoadGeometryFromStorage(
const ExtensionId& extension_id) { … }
AppWindowGeometryCache* AppWindowGeometryCache::Factory::GetForContext(
content::BrowserContext* context,
bool create) { … }
AppWindowGeometryCache::Factory*
AppWindowGeometryCache::Factory::GetInstance() { … }
AppWindowGeometryCache::Factory::Factory()
: … { … }
AppWindowGeometryCache::Factory::~Factory() = default;
std::unique_ptr<KeyedService>
AppWindowGeometryCache::Factory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const { … }
content::BrowserContext*
AppWindowGeometryCache::Factory::GetBrowserContextToUse(
content::BrowserContext* context) const { … }
void AppWindowGeometryCache::AddObserver(Observer* observer) { … }
void AppWindowGeometryCache::RemoveObserver(Observer* observer) { … }
}