#include "chrome/browser/extensions/api/instance_id/instance_id_api.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "chrome/browser/gcm/instance_id/instance_id_profile_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/instance_id.h"
#include "components/gcm_driver/instance_id/instance_id_driver.h"
#include "components/gcm_driver/instance_id/instance_id_profile_service.h"
#include "extensions/common/extension.h"
namespace extensions {
namespace {
const char kInvalidParameter[] = …;
const char kDisabled[] = …;
const char kAsyncOperationPending[] = …;
const char kNetworkError[] = …;
const char kServerError[] = …;
const char kUnknownError[] = …;
const char* InstanceIDResultToError(instance_id::InstanceID::Result result) { … }
}
InstanceIDApiFunction::InstanceIDApiFunction() = default;
InstanceIDApiFunction::~InstanceIDApiFunction() = default;
ExtensionFunction::ResponseAction InstanceIDApiFunction::Run() { … }
instance_id::InstanceID* InstanceIDApiFunction::GetInstanceID() const { … }
InstanceIDGetIDFunction::InstanceIDGetIDFunction() { … }
InstanceIDGetIDFunction::~InstanceIDGetIDFunction() { … }
ExtensionFunction::ResponseAction InstanceIDGetIDFunction::DoWork() { … }
void InstanceIDGetIDFunction::GetIDCompleted(const std::string& id) { … }
InstanceIDGetCreationTimeFunction::InstanceIDGetCreationTimeFunction() { … }
InstanceIDGetCreationTimeFunction::~InstanceIDGetCreationTimeFunction() { … }
ExtensionFunction::ResponseAction InstanceIDGetCreationTimeFunction::DoWork() { … }
void InstanceIDGetCreationTimeFunction::GetCreationTimeCompleted(
const base::Time& creation_time) { … }
InstanceIDGetTokenFunction::InstanceIDGetTokenFunction() { … }
InstanceIDGetTokenFunction::~InstanceIDGetTokenFunction() { … }
ExtensionFunction::ResponseAction InstanceIDGetTokenFunction::DoWork() { … }
void InstanceIDGetTokenFunction::GetTokenCompleted(
const std::string& token,
instance_id::InstanceID::Result result) { … }
InstanceIDDeleteTokenFunction::InstanceIDDeleteTokenFunction() { … }
InstanceIDDeleteTokenFunction::~InstanceIDDeleteTokenFunction() { … }
ExtensionFunction::ResponseAction InstanceIDDeleteTokenFunction::DoWork() { … }
void InstanceIDDeleteTokenFunction::DeleteTokenCompleted(
instance_id::InstanceID::Result result) { … }
InstanceIDDeleteIDFunction::InstanceIDDeleteIDFunction() { … }
InstanceIDDeleteIDFunction::~InstanceIDDeleteIDFunction() { … }
ExtensionFunction::ResponseAction InstanceIDDeleteIDFunction::DoWork() { … }
void InstanceIDDeleteIDFunction::DeleteIDCompleted(
instance_id::InstanceID::Result result) { … }
}