#ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_WIPEOUT_H_
#define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_WIPEOUT_H_
#include <list>
#include <string>
#include "base/basictypes.h"
#include "chrome/service/cloud_print/cloud_print_url_fetcher.h"
#include "url/gurl.h"
namespace cloud_print {
class CloudPrintWipeout : public CloudPrintURLFetcherDelegate {
public:
class Client {
public:
virtual void OnUnregisterPrintersComplete() = 0;
protected:
virtual ~Client() {}
};
CloudPrintWipeout(Client* client, const GURL& cloud_print_server_url);
virtual ~CloudPrintWipeout();
void UnregisterPrinters(const std::string& auth_token,
const std::list<std::string>& printer_ids);
virtual CloudPrintURLFetcher::ResponseAction HandleJSONData(
const net::URLFetcher* source,
const GURL& url,
base::DictionaryValue* json_data,
bool succeeded) OVERRIDE;
virtual void OnRequestGiveUp() OVERRIDE;
virtual CloudPrintURLFetcher::ResponseAction OnRequestAuthError() OVERRIDE;
virtual std::string GetAuthHeader() OVERRIDE;
private:
void UnregisterNextPrinter();
Client* client_;
GURL cloud_print_server_url_;
scoped_refptr<CloudPrintURLFetcher> request_;
std::string auth_token_;
std::list<std::string> printer_ids_;
DISALLOW_COPY_AND_ASSIGN(CloudPrintWipeout);
};
}
#endif