OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/content/browser/autocheckout_manager.h" | 5 #include "components/autofill/content/browser/autocheckout_manager.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "components/autofill/browser/autofill_country.h" | 10 #include "components/autofill/browser/autofill_country.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 SendAutocheckoutStatus(status); | 263 SendAutocheckoutStatus(status); |
264 autofill_manager_->delegate()->OnAutocheckoutSuccess(); | 264 autofill_manager_->delegate()->OnAutocheckoutSuccess(); |
265 in_autocheckout_flow_ = false; | 265 in_autocheckout_flow_ = false; |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 void AutocheckoutManager::OnFormsSeen() { | 269 void AutocheckoutManager::OnFormsSeen() { |
270 autocheckout_offered_ = false; | 270 autocheckout_offered_ = false; |
271 } | 271 } |
272 | 272 |
| 273 bool AutocheckoutManager::ShouldIgnoreAjax() { |
| 274 return in_autocheckout_flow_ && page_meta_data_->ignore_ajax; |
| 275 } |
| 276 |
273 void AutocheckoutManager::MaybeShowAutocheckoutBubble( | 277 void AutocheckoutManager::MaybeShowAutocheckoutBubble( |
274 const GURL& frame_url, | 278 const GURL& frame_url, |
275 const content::SSLStatus& ssl_status, | 279 const content::SSLStatus& ssl_status, |
276 const gfx::RectF& bounding_box) { | 280 const gfx::RectF& bounding_box) { |
277 if (autocheckout_offered_ || | 281 if (autocheckout_offered_ || |
278 is_autocheckout_bubble_showing_ || | 282 is_autocheckout_bubble_showing_ || |
279 !IsStartOfAutofillableFlow()) | 283 !IsStartOfAutofillableFlow()) |
280 return; | 284 return; |
281 | 285 |
282 base::Callback<void(const std::string&)> callback = base::Bind( | 286 base::Callback<void(const std::string&)> callback = base::Bind( |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 google_transaction_id_); | 480 google_transaction_id_); |
477 | 481 |
478 // Log the result of this Autocheckout flow to UMA. | 482 // Log the result of this Autocheckout flow to UMA. |
479 metric_logger_->LogAutocheckoutBuyFlowMetric( | 483 metric_logger_->LogAutocheckoutBuyFlowMetric( |
480 AutocheckoutStatusToUmaMetric(status)); | 484 AutocheckoutStatusToUmaMetric(status)); |
481 | 485 |
482 google_transaction_id_ = kTransactionIdNotSet; | 486 google_transaction_id_ = kTransactionIdNotSet; |
483 } | 487 } |
484 | 488 |
485 } // namespace autofill | 489 } // namespace autofill |
OLD | NEW |