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

Unified Diff: components/autofill/core/browser/autofill_xml_parser.cc

Issue 23033016: Remove autocheckout code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Even more deletes, and Ilya review. Created 7 years, 4 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/core/browser/autofill_xml_parser.cc
diff --git a/components/autofill/core/browser/autofill_xml_parser.cc b/components/autofill/core/browser/autofill_xml_parser.cc
index c1acbe90f7f71da7130ace1318a57d350981572f..caa101b227f1c314531b2d22ef57aa7ed88ec31b 100644
--- a/components/autofill/core/browser/autofill_xml_parser.cc
+++ b/components/autofill/core/browser/autofill_xml_parser.cc
@@ -8,8 +8,6 @@
#include <string.h>
#include "base/logging.h"
-#include "base/strings/string_number_conversions.h"
-#include "components/autofill/content/browser/autocheckout_page_meta_data.h"
#include "components/autofill/core/browser/autofill_server_field_info.h"
#include "third_party/libjingle/source/talk/xmllite/qname.h"
@@ -37,18 +35,12 @@ void AutofillXmlParser::Error(buzz::XmlParseContext* context,
AutofillQueryXmlParser::AutofillQueryXmlParser(
std::vector<AutofillServerFieldInfo>* field_infos,
UploadRequired* upload_required,
- std::string* experiment_id,
- AutocheckoutPageMetaData* page_meta_data)
+ std::string* experiment_id)
: field_infos_(field_infos),
upload_required_(upload_required),
- experiment_id_(experiment_id),
- page_meta_data_(page_meta_data),
- current_click_element_(NULL),
- current_page_number_for_page_types_(0),
- is_in_type_section_(false) {
+ experiment_id_(experiment_id) {
DCHECK(upload_required_);
DCHECK(experiment_id_);
- DCHECK(page_meta_data_);
}
AutofillQueryXmlParser::~AutofillQueryXmlParser() {}
@@ -112,48 +104,6 @@ void AutofillQueryXmlParser::StartElement(buzz::XmlParseContext* context,
// Record this field type, default value pair.
field_infos_->push_back(field_info);
- } else if (element.compare("autofill_flow") == 0) {
- // |attrs| is a NULL-terminated list of (attribute, value) pairs.
- while (*attrs) {
- buzz::QName attribute_qname = context->ResolveQName(*attrs, true);
- ++attrs;
- const std::string& attribute_name = attribute_qname.LocalPart();
- if (attribute_name.compare("page_no") == 0)
- page_meta_data_->current_page_number = GetIntValue(context, *attrs);
- else if (attribute_name.compare("total_pages") == 0)
- page_meta_data_->total_pages = GetIntValue(context, *attrs);
- else if (attribute_name.compare("ignore_ajax") == 0)
- page_meta_data_->ignore_ajax = strcmp(*attrs, "false") != 0;
- ++attrs;
- }
- } else if (element.compare("page_advance_button") == 0) {
- page_meta_data_->proceed_element_descriptor = WebElementDescriptor();
- ParseElementDescriptor(context,
- attrs,
- &page_meta_data_->proceed_element_descriptor);
- } else if (element.compare("click_elements_before_formfill") == 0) {
- page_meta_data_->click_elements_before_form_fill.push_back(
- WebElementDescriptor());
- current_click_element_ = &page_meta_data_->click_elements_before_form_fill.
- back();
- } else if (element.compare("click_elements_after_formfill") == 0) {
- page_meta_data_->click_elements_after_form_fill.push_back(
- WebElementDescriptor());
- current_click_element_ = &page_meta_data_->click_elements_after_form_fill.
- back();
- } else if (element.compare("web_element") == 0) {
- ParseElementDescriptor(context, attrs, current_click_element_);
- } else if (element.compare("flow_page") == 0) {
- while (*attrs) {
- buzz::QName attribute_qname = context->ResolveQName(*attrs, true);
- ++attrs;
- const std::string& attribute_name = attribute_qname.LocalPart();
- if (attribute_name.compare("page_no") == 0)
- current_page_number_for_page_types_ = GetIntValue(context, *attrs);
- ++attrs;
- }
- } else if (element.compare("type") == 0) {
- is_in_type_section_ = true;
}
}
@@ -185,27 +135,6 @@ void AutofillQueryXmlParser::ParseElementDescriptor(
}
}
-void AutofillQueryXmlParser::EndElement(buzz::XmlParseContext* context,
- const char* name) {
- is_in_type_section_ = false;
-}
-
-void AutofillQueryXmlParser::CharacterData(
- buzz::XmlParseContext* context, const char* text, int len) {
- if (!is_in_type_section_)
- return;
-
- int type = -1;
- base::StringToInt(std::string(text, len), &type);
- if (type >= AUTOCHECKOUT_STEP_MIN_VALUE &&
- type <= AUTOCHECKOUT_STEP_MAX_VALUE) {
- AutocheckoutStepType step_type =
- static_cast<AutocheckoutStepType>(type);
- page_meta_data_->page_types[current_page_number_for_page_types_]
- .push_back(step_type);
- }
-}
-
int AutofillQueryXmlParser::GetIntValue(buzz::XmlParseContext* context,
const char* attribute) {
char* attr_end = NULL;

Powered by Google App Engine
This is Rietveld 408576698