Factor parsing "ln=" to SuggestionAnswer

Multiple parts of the code need to access the "ln="
field, if any, in the second line text fields of a
SuggestionAnswer. Move the parse and access method
to a central place, and fix up the callers.

BUG=

Review-Url: https://codereview.chromium.org/2091473003
Cr-Commit-Position: refs/heads/master@{#403169}
diff --git a/components/omnibox/browser/suggestion_answer_unittest.cc b/components/omnibox/browser/suggestion_answer_unittest.cc
index a75e4123..ff8395f 100644
--- a/components/omnibox/browser/suggestion_answer_unittest.cc
+++ b/components/omnibox/browser/suggestion_answer_unittest.cc
@@ -199,10 +199,10 @@
 TEST(SuggestionAnswerTest, ValidPropertyValues) {
   std::string json =
       "{ \"l\": ["
-      "  { \"il\": { \"t\": [{ \"t\": \"text\", \"tt\": 8, \"ln\": 3 }, "
+      "  { \"il\": { \"t\": [{ \"t\": \"text\", \"tt\": 8 }, "
       "                      { \"t\": \"moar text\", \"tt\": 0 }], "
       "              \"i\": { \"d\": \"//example.com/foo.jpg\" } } }, "
-      "  { \"il\": { \"t\": [{ \"t\": \"other text\", \"tt\": 5 }], "
+      "  { \"il\": { \"t\": [{ \"t\": \"other text\", \"tt\": 5, \"ln\": 3 }], "
       "              \"at\": { \"t\": \"slatfatf\", \"tt\": 42 }, "
       "              \"st\": { \"t\": \"oh hi, Mark\", \"tt\": 729347 } } } "
       "] }";
@@ -215,11 +215,10 @@
   EXPECT_EQ(2U, first_line.text_fields().size());
   EXPECT_EQ(base::UTF8ToUTF16("text"), first_line.text_fields()[0].text());
   EXPECT_EQ(8, first_line.text_fields()[0].type());
-  EXPECT_TRUE(first_line.text_fields()[0].has_num_lines());
-  EXPECT_EQ(3, first_line.text_fields()[0].num_lines());
   EXPECT_EQ(base::UTF8ToUTF16("moar text"), first_line.text_fields()[1].text());
   EXPECT_EQ(0, first_line.text_fields()[1].type());
   EXPECT_FALSE(first_line.text_fields()[1].has_num_lines());
+  EXPECT_EQ(1, first_line.num_text_lines());
 
   EXPECT_FALSE(first_line.additional_text());
   EXPECT_FALSE(first_line.status_text());
@@ -232,6 +231,9 @@
   EXPECT_EQ(
       base::UTF8ToUTF16("other text"), second_line.text_fields()[0].text());
   EXPECT_EQ(5, second_line.text_fields()[0].type());
+  EXPECT_TRUE(second_line.text_fields()[0].has_num_lines());
+  EXPECT_EQ(3, second_line.text_fields()[0].num_lines());
+  EXPECT_EQ(3, second_line.num_text_lines());
 
   EXPECT_TRUE(second_line.additional_text());
   EXPECT_EQ(