#include "chrome/browser/feedback/feedback_uploader_chrome.h"
#include "base/functional/bind.h"
#include "base/strings/stringprintf.h"
#include "build/chromeos_buildflags.h"
#include "build/config/chromebox_for_meetings/buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "components/feedback/feedback_report.h"
#include "components/signin/public/base/consent_level.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/primary_account_access_token_fetcher.h"
#include "components/signin/public/identity_manager/scope_set.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "google_apis/gaia/gaia_constants.h"
#include "services/network/public/cpp/resource_request.h"
#if BUILDFLAG(PLATFORM_CFM)
#include "chrome/browser/ash/policy/enrollment/enrollment_requisition_manager.h"
#include "chrome/browser/device_identity/device_identity_provider.h"
#include "chrome/browser/device_identity/device_oauth2_token_service_factory.h"
#endif
namespace feedback {
namespace {
constexpr char kAuthenticationErrorLogMessage[] = …;
constexpr char kConsumer[] = …;
void QueueSingleReport(base::WeakPtr<feedback::FeedbackUploader> uploader,
scoped_refptr<FeedbackReport> report) { … }
scoped_refptr<network::SharedURLLoaderFactory>
CreateURLLoaderFactoryForBrowserContext(content::BrowserContext* context) { … }
}
FeedbackUploaderChrome::FeedbackUploaderChrome(content::BrowserContext* context)
: … { … }
FeedbackUploaderChrome::~FeedbackUploaderChrome() = default;
base::WeakPtr<FeedbackUploader> FeedbackUploaderChrome::AsWeakPtr() { … }
void FeedbackUploaderChrome::PrimaryAccountAccessTokenAvailable(
GoogleServiceAuthError error,
signin::AccessTokenInfo access_token_info) { … }
#if BUILDFLAG(PLATFORM_CFM)
void FeedbackUploaderChrome::ActiveAccountAccessTokenAvailable(
GoogleServiceAuthError error,
std::string token) {
DCHECK(active_account_token_fetcher_);
active_account_token_fetcher_.reset();
AccessTokenAvailable(error, token);
}
#endif
void FeedbackUploaderChrome::AccessTokenAvailable(GoogleServiceAuthError error,
std::string token) { … }
void FeedbackUploaderChrome::StartDispatchingReport() { … }
void FeedbackUploaderChrome::AppendExtraHeadersToUploadRequest(
network::ResourceRequest* resource_request) { … }
}