Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Unified Diff: components/autofill/browser/autocheckout_request_manager.cc

Issue 12457033: Implements SendAutocheckoutStatus API calls for stats tracking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaning up Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/browser/autocheckout_request_manager.cc
diff --git a/components/autofill/browser/autocheckout_request_manager.cc b/components/autofill/browser/autocheckout_request_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..74969ff1f319ddc0fe20fb4b60285c7b24063e7d
--- /dev/null
+++ b/components/autofill/browser/autocheckout_request_manager.cc
@@ -0,0 +1,130 @@
+
Ilya Sherman 2013/03/26 23:50:01 License block goes here.
ahutter 2013/03/27 01:23:33 Done.
+#include "components/autofill/browser/autocheckout_request_manager.h"
+
+#include "components/autofill/browser/autofill_manager_delegate.h"
+#include "content/public/browser/browser_context.h"
+
+namespace {
+
+const char kAutocheckoutRequestManagerKey[] =
+ "browser_context_autocheckout_request_manager";
+
+} // namespace
+
+namespace autofill {
+
+AutocheckoutRequestManager::~AutocheckoutRequestManager() {}
+
+// static
+void AutocheckoutRequestManager::CreateFromBrowserContext(
+ content::BrowserContext* browser_context) {
+ if (FromBrowserContext(browser_context))
+ return;
+
+ browser_context->SetUserData(
+ kAutocheckoutRequestManagerKey,
+ new AutocheckoutRequestManager(browser_context->GetRequestContext()));
+}
+
+// static
+AutocheckoutRequestManager* AutocheckoutRequestManager::FromBrowserContext(
+ content::BrowserContext* browser_context) {
+ return static_cast<AutocheckoutRequestManager*>(
+ browser_context->GetUserData(kAutocheckoutRequestManagerKey));
+}
+
+void AutocheckoutRequestManager::SendAutocheckoutStatus(
+ AutocheckoutStatus status,
+ const GURL& source_url,
+ const std::string& google_transaction_id) {
+ wallet_client_.SendAutocheckoutStatus(status,
+ source_url,
+ google_transaction_id);
+}
+
+
+const AutofillMetrics& AutocheckoutRequestManager::GetMetricLogger() const {
+ return metric_logger_;
+}
+
+DialogType AutocheckoutRequestManager::GetDialogType() const {
+ return DIALOG_TYPE_AUTOCHECKOUT;
+}
+
+std::string AutocheckoutRequestManager::GetRiskData() const {
+ NOTREACHED();
+ return std::string();
+}
+
+void AutocheckoutRequestManager::OnDidAcceptLegalDocuments() {
+ NOTREACHED();
+}
+
+void AutocheckoutRequestManager::OnDidAuthenticateInstrument(bool success) {
+ NOTREACHED();
+}
+
+void AutocheckoutRequestManager::OnDidGetFullWallet(
+ scoped_ptr<wallet::FullWallet> full_wallet) {
+ NOTREACHED();
+}
+
+void AutocheckoutRequestManager::OnDidGetWalletItems(
+ scoped_ptr<wallet::WalletItems> wallet_items) {
+ NOTREACHED();
+}
+
+void AutocheckoutRequestManager::OnDidSaveAddress(
+ const std::string& address_id,
+ const std::vector<wallet::RequiredAction>& required_actions) {
+ NOTREACHED();
+}
+
+void AutocheckoutRequestManager::OnDidSaveInstrument(
+ const std::string& instrument_id,
+ const std::vector<wallet::RequiredAction>& required_actions) {
+ NOTREACHED();
+}
+
+void AutocheckoutRequestManager::OnDidSaveInstrumentAndAddress(
+ const std::string& instrument_id,
+ const std::string& address_id,
+ const std::vector<wallet::RequiredAction>& required_actions) {
+ NOTREACHED();
+}
+
+void AutocheckoutRequestManager::OnDidSendAutocheckoutStatus() {
+ // This doesn't really do anything. Should I just remove it?
Ilya Sherman 2013/03/26 23:50:01 Yes, let's remove it if it's not used.
ahutter 2013/03/27 01:23:33 Done.
+}
+
+void AutocheckoutRequestManager::OnDidUpdateAddress(
+ const std::string& address_id,
+ const std::vector<wallet::RequiredAction>& required_actions) {
+ NOTREACHED();
+}
+
+void AutocheckoutRequestManager::OnDidUpdateInstrument(
+ const std::string& instrument_id,
+ const std::vector<wallet::RequiredAction>& required_actions) {
+ NOTREACHED();
+}
+
+void AutocheckoutRequestManager::OnWalletError(
+ wallet::WalletClient::ErrorType error_type) {
+ // I think this is already logged somewhere...
Ilya Sherman 2013/03/26 23:50:01 Indeed, logged by the MetricLogger. Please update
ahutter 2013/03/27 01:23:33 Done.
+}
+
+void AutocheckoutRequestManager::OnMalformedResponse() {
+ // Nothing to be done.
+}
+
+void AutocheckoutRequestManager::OnNetworkError(int response_code) {
+ // I think this is already logged somewhere...
Ilya Sherman 2013/03/26 23:50:01 Ditto.
ahutter 2013/03/27 01:23:33 Done.
+}
+
+AutocheckoutRequestManager::AutocheckoutRequestManager(
+ net::URLRequestContextGetter* request_context_getter)
+ : wallet_client_(request_context_getter, this) {
+}
+
+} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698