Merge from Chromium at DEPS revision 267aeeb8d85c

This commit was generated by merge_to_master.py.

Change-Id: Iaefacfbaf2c0ada6291fa03d6f3ff648e2d21956
diff --git a/cpp/include/libaddressinput/address_data.h b/cpp/include/libaddressinput/address_data.h
index e2d057a..89d3273 100644
--- a/cpp/include/libaddressinput/address_data.h
+++ b/cpp/include/libaddressinput/address_data.h
@@ -55,6 +55,10 @@
   // Language code of the address. Should be in BCP-47 format.
   std::string language_code;
 
+  // The organization, firm, company, or institution at this address. This
+  // corresponds to the FirmName sub-element of the xAL FirmType element.
+  std::string organization;
+
   // Name of recipient or contact person. Not present in xAL.
   std::string recipient;
 
diff --git a/cpp/include/libaddressinput/address_field.h b/cpp/include/libaddressinput/address_field.h
index 1adc97b..8f2ee05 100644
--- a/cpp/include/libaddressinput/address_field.h
+++ b/cpp/include/libaddressinput/address_field.h
@@ -31,6 +31,7 @@
   SORTING_CODE,        // Sorting code.
   POSTAL_CODE,         // Zip or postal code.
   STREET_ADDRESS,      // Street address lines.
+  ORGANIZATION,        // Organization, company, firm, institution, etc.
   RECIPIENT            // Name.
 };
 
diff --git a/cpp/include/libaddressinput/localization.h b/cpp/include/libaddressinput/localization.h
index 9d31265..5e7896d 100644
--- a/cpp/include/libaddressinput/localization.h
+++ b/cpp/include/libaddressinput/localization.h
@@ -17,6 +17,7 @@
 
 #include <libaddressinput/address_field.h>
 #include <libaddressinput/address_problem.h>
+#include <libaddressinput/util/basictypes.h>
 
 #include <string>
 
@@ -83,6 +84,8 @@
 
   // The string getter.
   std::string (*get_string_)(int);
+
+  DISALLOW_COPY_AND_ASSIGN(Localization);
 };
 
 }  // namespace addressinput
diff --git a/cpp/res/messages.grdp b/cpp/res/messages.grdp
index c04449a..7ca2000 100644
--- a/cpp/res/messages.grdp
+++ b/cpp/res/messages.grdp
@@ -113,6 +113,13 @@
     State
   </message>
   <message
+      name="IDS_LIBADDRESSINPUT_ORGANIZATION_LABEL"
+      desc="Label for the field of organization, firm, company, or institution
+            in an address. Examples of values in this field: Google,
+            Department of Transportation, University of Cambridge.">
+    Organization
+  </message>
+  <message
       name="IDS_LIBADDRESSINPUT_RECIPIENT_LABEL"
       desc="Label for the field for a person's name in an address.">
     Name
diff --git a/cpp/src/address_data.cc b/cpp/src/address_data.cc
index 644000e..40d3ee7 100644
--- a/cpp/src/address_data.cc
+++ b/cpp/src/address_data.cc
@@ -41,6 +41,7 @@
   &AddressData::sorting_code,
   &AddressData::postal_code,
   NULL,
+  &AddressData::organization,
   &AddressData::recipient
 };
 
@@ -53,6 +54,7 @@
   NULL,
   NULL,
   &AddressData::address_line,
+  NULL,
   NULL
 };
 
@@ -111,7 +113,9 @@
          dependent_locality == other.dependent_locality &&
          postal_code == other.postal_code &&
          sorting_code == other.sorting_code &&
-         language_code == other.language_code && recipient == other.recipient;
+         language_code == other.language_code &&
+         organization == other.organization &&
+         recipient == other.recipient;
 }
 
 // static
@@ -142,6 +146,7 @@
   }
 
   o << "language_code: \"" << address.language_code << "\"\n"
+    "organization: \"" << address.organization << "\"\n"
     "recipient: \"" << address.recipient << "\"\n";
 
   return o;
diff --git a/cpp/src/address_field.cc b/cpp/src/address_field.cc
index 7d57e06..c5c96d8 100644
--- a/cpp/src/address_field.cc
+++ b/cpp/src/address_field.cc
@@ -32,6 +32,7 @@
     "SORTING_CODE",
     "POSTAL_CODE",
     "STREET_ADDRESS",
+    "ORGANIZATION",
     "RECIPIENT"
   };
   COMPILE_ASSERT(COUNTRY == 0, bad_base);
diff --git a/cpp/src/address_field_util.cc b/cpp/src/address_field_util.cc
index 1cac289..26de3c0 100644
--- a/cpp/src/address_field_util.cc
+++ b/cpp/src/address_field_util.cc
@@ -40,6 +40,7 @@
   fields.insert(std::make_pair('X', SORTING_CODE));
   fields.insert(std::make_pair('Z', POSTAL_CODE));
   fields.insert(std::make_pair('A', STREET_ADDRESS));
+  fields.insert(std::make_pair('O', ORGANIZATION));
   fields.insert(std::make_pair('N', RECIPIENT));
   return fields;
 }
diff --git a/cpp/src/address_ui.cc b/cpp/src/address_ui.cc
index bf76cfd..33f0797 100644
--- a/cpp/src/address_ui.cc
+++ b/cpp/src/address_ui.cc
@@ -63,6 +63,9 @@
     case STREET_ADDRESS:
       messageId = IDS_LIBADDRESSINPUT_ADDRESS_LINE_1_LABEL;
       break;
+    case ORGANIZATION:
+      messageId = IDS_LIBADDRESSINPUT_ORGANIZATION_LABEL;
+      break;
     case RECIPIENT:
       messageId = IDS_LIBADDRESSINPUT_RECIPIENT_LABEL;
       break;
diff --git a/cpp/src/localization.cc b/cpp/src/localization.cc
index 737d8c9..b544cd9 100644
--- a/cpp/src/localization.cc
+++ b/cpp/src/localization.cc
@@ -31,10 +31,11 @@
 
 namespace {
 
-void PushBackUrl(std::vector<std::string>& parameters, const std::string url) {
+void PushBackUrl(const std::string& url, std::vector<std::string>* parameters) {
+  assert(parameters != NULL);
   // TODO: HTML-escape the "url".
-  parameters.push_back("<a href=\"" + url + "\">");
-  parameters.push_back("</a>");
+  parameters->push_back("<a href=\"" + url + "\">");
+  parameters->push_back("</a>");
 }
 
 }  // namespace
@@ -137,7 +138,7 @@
           IDS_LIBADDRESSINPUT_MISSING_REQUIRED_POSTAL_CODE_EXAMPLE_AND_URL :
           IDS_LIBADDRESSINPUT_MISSING_REQUIRED_ZIP_CODE_EXAMPLE_AND_URL;
       parameters.push_back(postal_code_example);
-      PushBackUrl(parameters, post_service_url);
+      PushBackUrl(post_service_url, &parameters);
     } else if (!postal_code_example.empty()) {
       message_id = uses_postal_code_as_label ?
           IDS_LIBADDRESSINPUT_MISSING_REQUIRED_POSTAL_CODE_EXAMPLE :
@@ -153,7 +154,7 @@
           IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_POSTAL_CODE_EXAMPLE_AND_URL :
           IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_ZIP_CODE_EXAMPLE_AND_URL;
       parameters.push_back(postal_code_example);
-      PushBackUrl(parameters, post_service_url);
+      PushBackUrl(post_service_url, &parameters);
     } else if (!postal_code_example.empty()) {
       message_id = uses_postal_code_as_label ?
           IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_POSTAL_CODE_EXAMPLE :
@@ -170,7 +171,7 @@
       message_id = uses_postal_code_as_label ?
           IDS_LIBADDRESSINPUT_MISMATCHING_VALUE_POSTAL_CODE_URL :
           IDS_LIBADDRESSINPUT_MISMATCHING_VALUE_ZIP_URL;
-      PushBackUrl(parameters, post_service_url);
+      PushBackUrl(post_service_url, &parameters);
     } else {
       message_id = uses_postal_code_as_label ?
           IDS_LIBADDRESSINPUT_MISMATCHING_VALUE_POSTAL_CODE :
diff --git a/cpp/src/ondemand_supply_task.cc b/cpp/src/ondemand_supply_task.cc
index f46d475..a4f6a12 100644
--- a/cpp/src/ondemand_supply_task.cc
+++ b/cpp/src/ondemand_supply_task.cc
@@ -63,7 +63,7 @@
   } else {
     // When the final pending rule has been retrieved, the retrieved_ callback,
     // implemented by Load(), will finish by calling Loaded(), which will finish
-    // by delete'ing this RuleHierarchy object. So after the final call to
+    // by delete'ing this OndemandSupplyTask object. So after the final call to
     // retriever.Retrieve() no attributes of this object can be accessed (as the
     // object then no longer will exist, if the final callback has finished by
     // then), and the condition statement of the loop must therefore not use the
diff --git a/cpp/src/post_box_matchers.h b/cpp/src/post_box_matchers.h
index c269f11..9924a2c 100644
--- a/cpp/src/post_box_matchers.h
+++ b/cpp/src/post_box_matchers.h
@@ -17,6 +17,8 @@
 #ifndef I18N_ADDRESSINPUT_POST_BOX_MATCHERS_H_
 #define I18N_ADDRESSINPUT_POST_BOX_MATCHERS_H_
 
+#include <libaddressinput/util/basictypes.h>
+
 #include <vector>
 
 namespace i18n {
@@ -30,6 +32,9 @@
   // Returns pointers to RE2 regular expression objects to test address lines
   // for those languages that are relevant for |country_rule|.
   static std::vector<const RE2ptr*> GetMatchers(const Rule& country_rule);
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(PostBoxMatchers);
 };
 
 }  // namespace addressinput
diff --git a/cpp/src/region_data_constants.h b/cpp/src/region_data_constants.h
index 7a2c133..4159e72 100644
--- a/cpp/src/region_data_constants.h
+++ b/cpp/src/region_data_constants.h
@@ -15,6 +15,8 @@
 #ifndef I18N_ADDRESSINPUT_REGION_DATA_CONSTANTS_H_
 #define I18N_ADDRESSINPUT_REGION_DATA_CONSTANTS_H_
 
+#include <libaddressinput/util/basictypes.h>
+
 #include <cstddef>
 #include <string>
 #include <vector>
@@ -29,6 +31,9 @@
   static const std::string& GetRegionData(const std::string& region_code);
   static const std::string& GetDefaultRegionData();
   static size_t GetMaxLookupKeyDepth(const std::string& region_code);
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(RegionDataConstants);
 };
 
 }  // namespace addressinput
diff --git a/cpp/src/validating_util.cc b/cpp/src/validating_util.cc
index 084c09c..9356689 100644
--- a/cpp/src/validating_util.cc
+++ b/cpp/src/validating_util.cc
@@ -84,7 +84,8 @@
 void ValidatingUtil::Wrap(time_t timestamp, std::string* data) {
   assert(data != NULL);
   char timestamp_string[2 + 3 * sizeof timestamp];
-  int size = std::sprintf(timestamp_string, "%ld", timestamp);
+  int size =
+      std::sprintf(timestamp_string, "%ld", static_cast<long>(timestamp));
   assert(size > 0);
   assert(size < sizeof timestamp_string);
   (void)size;
diff --git a/cpp/src/validating_util.h b/cpp/src/validating_util.h
index 1357651..20d541b 100644
--- a/cpp/src/validating_util.h
+++ b/cpp/src/validating_util.h
@@ -19,6 +19,8 @@
 #ifndef I18N_ADDRESSINPUT_VALIDATING_UTIL_H_
 #define I18N_ADDRESSINPUT_VALIDATING_UTIL_H_
 
+#include <libaddressinput/util/basictypes.h>
+
 #include <ctime>
 #include <string>
 
@@ -47,6 +49,9 @@
   // Strips out the checksum from |data|. Returns |true| if the checksum is
   // present, formatted correctly, and valid for this data.
   static bool UnwrapChecksum(std::string* data);
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(ValidatingUtil);
 };
 
 }  // namespace addressinput
diff --git a/cpp/src/validation_task.cc b/cpp/src/validation_task.cc
index 727de6a..1e7911a 100644
--- a/cpp/src/validation_task.cc
+++ b/cpp/src/validation_task.cc
@@ -110,6 +110,7 @@
     SORTING_CODE,
     POSTAL_CODE,
     STREET_ADDRESS,
+    ORGANIZATION,
     RECIPIENT
   };
 
@@ -132,7 +133,8 @@
     DEPENDENT_LOCALITY,
     SORTING_CODE,
     POSTAL_CODE,
-    STREET_ADDRESS,
+    STREET_ADDRESS
+    // ORGANIZATION is never required.
     // RECIPIENT is handled separately.
   };
 
diff --git a/cpp/test/address_data_test.cc b/cpp/test/address_data_test.cc
index 8ba0f4b..46491c9 100644
--- a/cpp/test/address_data_test.cc
+++ b/cpp/test/address_data_test.cc
@@ -32,6 +32,7 @@
 using i18n::addressinput::SORTING_CODE;
 using i18n::addressinput::POSTAL_CODE;
 using i18n::addressinput::STREET_ADDRESS;
+using i18n::addressinput::ORGANIZATION;
 using i18n::addressinput::RECIPIENT;
 
 TEST(AddressDataTest, GetFieldValue) {
@@ -42,6 +43,7 @@
   address.dependent_locality = "ddd";
   address.sorting_code = "xxx";
   address.postal_code = "zzz";
+  address.organization = "ooo";
   address.recipient = "nnn";
 
   EXPECT_EQ(address.region_code,
@@ -56,6 +58,8 @@
             address.GetFieldValue(SORTING_CODE));
   EXPECT_EQ(address.postal_code,
             address.GetFieldValue(POSTAL_CODE));
+  EXPECT_EQ(address.organization,
+            address.GetFieldValue(ORGANIZATION));
   EXPECT_EQ(address.recipient,
             address.GetFieldValue(RECIPIENT));
 }
@@ -78,6 +82,7 @@
   EXPECT_TRUE(address.IsFieldEmpty(SORTING_CODE));
   EXPECT_TRUE(address.IsFieldEmpty(POSTAL_CODE));
   EXPECT_TRUE(address.IsFieldEmpty(STREET_ADDRESS));
+  EXPECT_TRUE(address.IsFieldEmpty(ORGANIZATION));
   EXPECT_TRUE(address.IsFieldEmpty(RECIPIENT));
 
   address.region_code = "rrr";
@@ -87,6 +92,7 @@
   address.sorting_code = "xxx";
   address.postal_code = "zzz";
   address.address_line.push_back("aaa");
+  address.organization = "ooo";
   address.recipient = "nnn";
 
   EXPECT_FALSE(address.IsFieldEmpty(COUNTRY));
@@ -96,6 +102,7 @@
   EXPECT_FALSE(address.IsFieldEmpty(SORTING_CODE));
   EXPECT_FALSE(address.IsFieldEmpty(POSTAL_CODE));
   EXPECT_FALSE(address.IsFieldEmpty(STREET_ADDRESS));
+  EXPECT_FALSE(address.IsFieldEmpty(ORGANIZATION));
   EXPECT_FALSE(address.IsFieldEmpty(RECIPIENT));
 }
 
@@ -149,6 +156,7 @@
   address.dependent_locality = "D";
   address.sorting_code = "X";
   address.language_code = "zh-Hant";
+  address.organization = "O";
   oss << address;
   EXPECT_EQ("region_code: \"R\"\n"
             "administrative_area: \"S\"\n"
@@ -159,6 +167,7 @@
             "address_line: \"Line 1\"\n"
             "address_line: \"Line 2\"\n"
             "language_code: \"zh-Hant\"\n"
+            "organization: \"O\"\n"
             "recipient: \"N\"\n", oss.str());
 }
 
@@ -173,6 +182,7 @@
   address.locality = "C";
   address.dependent_locality = "D";
   address.sorting_code = "X";
+  address.organization = "O";
   address.language_code = "zh-Hant";
 
   AddressData clone = address;
diff --git a/cpp/test/address_field_util_test.cc b/cpp/test/address_field_util_test.cc
index 0db6bf5..0cde367 100644
--- a/cpp/test/address_field_util_test.cc
+++ b/cpp/test/address_field_util_test.cc
@@ -26,20 +26,22 @@
 namespace {
 
 using i18n::addressinput::AddressField;
-using i18n::addressinput::COUNTRY;
 using i18n::addressinput::FormatElement;
-using i18n::addressinput::LOCALITY;
 using i18n::addressinput::ParseFormatRule;
+
+using i18n::addressinput::COUNTRY;
+using i18n::addressinput::LOCALITY;
 using i18n::addressinput::POSTAL_CODE;
-using i18n::addressinput::RECIPIENT;
 using i18n::addressinput::STREET_ADDRESS;
+using i18n::addressinput::ORGANIZATION;
+using i18n::addressinput::RECIPIENT;
 
 TEST(AddressFieldUtilTest, FormatParseNewline) {
   std::vector<FormatElement> actual;
   ParseFormatRule("%O%n%N%n%A%nAX-%Z %C%n\xC3\x85LAND", &actual);  /* "ÅLAND" */
 
   std::vector<FormatElement> expected;
-  // Organization is skipped.
+  expected.push_back(FormatElement(ORGANIZATION));
   expected.push_back(FormatElement());
   expected.push_back(FormatElement(RECIPIENT));
   expected.push_back(FormatElement());
diff --git a/cpp/test/address_input_helper_test.cc b/cpp/test/address_input_helper_test.cc
index cfae3f3..4014c91 100644
--- a/cpp/test/address_input_helper_test.cc
+++ b/cpp/test/address_input_helper_test.cc
@@ -49,8 +49,6 @@
         address_input_helper_(&supplier_),
         loaded_(BuildCallback(this, &AddressInputHelperTest::Loaded)) {}
 
-  ~AddressInputHelperTest() {}
-
   // Helper method to test FillAddress that ensures the PreloadSupplier has the
   // necessary data preloaded.
   void FillAddress(AddressData* address) {
@@ -249,8 +247,6 @@
         address_input_helper_(&supplier_),
         loaded_(BuildCallback(this, &AddressInputHelperMockDataTest::Loaded)) {}
 
-  ~AddressInputHelperMockDataTest() {}
-
   // Helper method to test FillAddress that ensures the PreloadSupplier has the
   // necessary data preloaded.
   void FillAddress(AddressData* address) {
diff --git a/cpp/test/address_normalizer_test.cc b/cpp/test/address_normalizer_test.cc
index 7a01d38..3a7acf2 100644
--- a/cpp/test/address_normalizer_test.cc
+++ b/cpp/test/address_normalizer_test.cc
@@ -44,8 +44,6 @@
         loaded_(BuildCallback(this, &AddressNormalizerTest::OnLoaded)),
         normalizer_(&supplier_) {}
 
-  virtual ~AddressNormalizerTest() {}
-
   PreloadSupplier supplier_;
   const scoped_ptr<const PreloadSupplier::Callback> loaded_;
   const AddressNormalizer normalizer_;
diff --git a/cpp/test/address_ui_test.cc b/cpp/test/address_ui_test.cc
index ccfd437..d2e512f 100644
--- a/cpp/test/address_ui_test.cc
+++ b/cpp/test/address_ui_test.cc
@@ -17,6 +17,7 @@
 #include <libaddressinput/address_field.h>
 #include <libaddressinput/address_ui_component.h>
 #include <libaddressinput/localization.h>
+#include <libaddressinput/util/basictypes.h>
 
 #include <set>
 #include <string>
@@ -28,14 +29,16 @@
 
 using i18n::addressinput::AddressField;
 using i18n::addressinput::AddressUiComponent;
-using i18n::addressinput::ADMIN_AREA;
 using i18n::addressinput::BuildComponents;
-using i18n::addressinput::COUNTRY;
 using i18n::addressinput::GetRegionCodes;
 using i18n::addressinput::Localization;
+
+using i18n::addressinput::COUNTRY;
+using i18n::addressinput::ADMIN_AREA;
 using i18n::addressinput::POSTAL_CODE;
-using i18n::addressinput::RECIPIENT;
 using i18n::addressinput::STREET_ADDRESS;
+using i18n::addressinput::ORGANIZATION;
+using i18n::addressinput::RECIPIENT;
 
 static const char kUiLanguageTag[] = "en";
 
@@ -70,8 +73,12 @@
 // Tests for address UI functions.
 class AddressUiTest : public testing::TestWithParam<std::string> {
  protected:
+  AddressUiTest() {}
   Localization localization_;
   std::string best_address_language_tag_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(AddressUiTest);
 };
 
 // Verifies that a region code consists of two characters, for example "TW".
@@ -142,8 +149,12 @@
 class BestAddressLanguageTagTest
     : public testing::TestWithParam<LanguageTestCase> {
  protected:
+  BestAddressLanguageTagTest() {}
   Localization localization_;
   std::string best_address_language_tag_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(BestAddressLanguageTagTest);
 };
 
 std::string GetterStub(int) { return std::string(); }
@@ -210,12 +221,12 @@
         LanguageTestCase("MO", "en", "zh-Latn", RECIPIENT),
 
         // Switzerland supports de, fr, and it.
-        LanguageTestCase("CH", "de", "de", RECIPIENT),
-        LanguageTestCase("CH", "de-DE", "de", RECIPIENT),
-        LanguageTestCase("CH", "de-Latn-DE", "de", RECIPIENT),
-        LanguageTestCase("CH", "fr", "fr", RECIPIENT),
-        LanguageTestCase("CH", "it", "it", RECIPIENT),
-        LanguageTestCase("CH", "en", "de", RECIPIENT),
+        LanguageTestCase("CH", "de", "de", ORGANIZATION),
+        LanguageTestCase("CH", "de-DE", "de", ORGANIZATION),
+        LanguageTestCase("CH", "de-Latn-DE", "de", ORGANIZATION),
+        LanguageTestCase("CH", "fr", "fr", ORGANIZATION),
+        LanguageTestCase("CH", "it", "it", ORGANIZATION),
+        LanguageTestCase("CH", "en", "de", ORGANIZATION),
 
         // Antarctica does not have language information.
         LanguageTestCase("AQ", "en", "en", RECIPIENT),
diff --git a/cpp/test/address_validator_test.cc b/cpp/test/address_validator_test.cc
index 0b4b025..3177b01 100644
--- a/cpp/test/address_validator_test.cc
+++ b/cpp/test/address_validator_test.cc
@@ -70,8 +70,6 @@
  public:
   static ValidatorWrapper* Build() { return new OndemandValidatorWrapper; }
 
-  virtual ~OndemandValidatorWrapper() {}
-
   virtual void Validate(const AddressData& address,
                         bool allow_postal,
                         bool require_name,
@@ -101,8 +99,6 @@
  public:
   static ValidatorWrapper* Build() { return new PreloadValidatorWrapper; }
 
-  virtual ~PreloadValidatorWrapper() {}
-
   virtual void Validate(const AddressData& address,
                         bool allow_postal,
                         bool require_name,
@@ -150,8 +146,6 @@
         validator_wrapper_((*GetParam())()),
         validated_(BuildCallback(this, &AddressValidatorTest::Validated)) {}
 
-  virtual ~AddressValidatorTest() {}
-
   void Validate() {
     validator_wrapper_->Validate(
         address_,
diff --git a/cpp/test/fake_storage.h b/cpp/test/fake_storage.h
index 55273c6..3a164c4 100644
--- a/cpp/test/fake_storage.h
+++ b/cpp/test/fake_storage.h
@@ -19,6 +19,7 @@
 #define I18N_ADDRESSINPUT_FAKE_STORAGE_H_
 
 #include <libaddressinput/storage.h>
+#include <libaddressinput/util/basictypes.h>
 
 #include <map>
 #include <string>
@@ -66,6 +67,7 @@
 
  private:
   std::map<std::string, std::string*> data_;
+  DISALLOW_COPY_AND_ASSIGN(FakeStorage);
 };
 
 }  // namespace addressinput
diff --git a/cpp/test/fake_storage_test.cc b/cpp/test/fake_storage_test.cc
index 275c9fc..5905f02 100644
--- a/cpp/test/fake_storage_test.cc
+++ b/cpp/test/fake_storage_test.cc
@@ -41,8 +41,6 @@
         data_(),
         data_ready_(BuildCallback(this, &FakeStorageTest::OnDataReady)) {}
 
-  virtual ~FakeStorageTest() {}
-
   FakeStorage storage_;
   bool success_;
   std::string key_;
diff --git a/cpp/test/language_test.cc b/cpp/test/language_test.cc
index 197459e..502031b 100644
--- a/cpp/test/language_test.cc
+++ b/cpp/test/language_test.cc
@@ -14,6 +14,8 @@
 
 #include "language.h"
 
+#include <libaddressinput/util/basictypes.h>
+
 #include <string>
 
 #include <gtest/gtest.h>
@@ -40,7 +42,13 @@
   const bool expected_has_latin_script;
 };
 
-class LanguageTest : public testing::TestWithParam<LanguageTestCase> {};
+class LanguageTest : public testing::TestWithParam<LanguageTestCase> {
+ protected:
+  LanguageTest() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(LanguageTest);
+};
 
 TEST_P(LanguageTest, ExtractedDataIsCorrect) {
   Language language(GetParam().input_language_tag);
diff --git a/cpp/test/localization_test.cc b/cpp/test/localization_test.cc
index b47d5c8..1eba5b8 100644
--- a/cpp/test/localization_test.cc
+++ b/cpp/test/localization_test.cc
@@ -17,6 +17,7 @@
 #include <libaddressinput/address_data.h>
 #include <libaddressinput/address_field.h>
 #include <libaddressinput/address_problem.h>
+#include <libaddressinput/util/basictypes.h>
 
 #include <string>
 #include <vector>
@@ -40,6 +41,7 @@
 using i18n::addressinput::SORTING_CODE;
 using i18n::addressinput::POSTAL_CODE;
 using i18n::addressinput::STREET_ADDRESS;
+using i18n::addressinput::ORGANIZATION;
 using i18n::addressinput::RECIPIENT;
 
 using i18n::addressinput::MISSING_REQUIRED_FIELD;
@@ -51,7 +53,11 @@
 // Tests for Localization object.
 class LocalizationTest : public testing::TestWithParam<int> {
  protected:
+  LocalizationTest() {}
   Localization localization_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(LocalizationTest);
 };
 
 // Verifies that a custom message getter can be used.
@@ -98,6 +104,7 @@
         IDS_LIBADDRESSINPUT_PREFECTURE,
         IDS_LIBADDRESSINPUT_PROVINCE,
         IDS_LIBADDRESSINPUT_STATE,
+        IDS_LIBADDRESSINPUT_ORGANIZATION_LABEL,
         IDS_LIBADDRESSINPUT_RECIPIENT_LABEL,
         IDS_LIBADDRESSINPUT_MISSING_REQUIRED_FIELD,
         IDS_LIBADDRESSINPUT_MISSING_REQUIRED_POSTAL_CODE_EXAMPLE_AND_URL,
@@ -176,6 +183,7 @@
   other_fields.push_back(DEPENDENT_LOCALITY);
   other_fields.push_back(SORTING_CODE);
   other_fields.push_back(STREET_ADDRESS);
+  other_fields.push_back(ORGANIZATION);
   other_fields.push_back(RECIPIENT);
   for (std::vector<AddressField>::iterator it = other_fields.begin();
        it != other_fields.end(); it++) {
@@ -206,6 +214,7 @@
   address_line.push_back("bad address line 1");
   address_line.push_back("bad address line 2");
   address.address_line = address_line;
+  address.organization = "bad organization";
   address.recipient = "bad recipient";
   EXPECT_EQ("US "
             "is not recognized as a known value for this field.",
@@ -303,6 +312,22 @@
             "is not recognized as a known value for this field.",
             localization.GetErrorMessage(
                 address, STREET_ADDRESS, UNKNOWN_VALUE, false, true));
+  EXPECT_EQ("bad organization "
+            "is not recognized as a known value for this field.",
+            localization.GetErrorMessage(
+                address, ORGANIZATION, UNKNOWN_VALUE, true, true));
+  EXPECT_EQ("bad organization "
+            "is not recognized as a known value for this field.",
+            localization.GetErrorMessage(
+                address, ORGANIZATION, UNKNOWN_VALUE, true, false));
+  EXPECT_EQ("bad organization "
+            "is not recognized as a known value for this field.",
+            localization.GetErrorMessage(
+                address, ORGANIZATION, UNKNOWN_VALUE, false, false));
+  EXPECT_EQ("bad organization "
+            "is not recognized as a known value for this field.",
+            localization.GetErrorMessage(
+                address, ORGANIZATION, UNKNOWN_VALUE, false, true));
   EXPECT_EQ("bad recipient "
             "is not recognized as a known value for this field.",
             localization.GetErrorMessage(
@@ -434,6 +459,7 @@
   other_fields.push_back(DEPENDENT_LOCALITY);
   other_fields.push_back(SORTING_CODE);
   other_fields.push_back(STREET_ADDRESS);
+  other_fields.push_back(ORGANIZATION);
   other_fields.push_back(RECIPIENT);
   for (std::vector<AddressField>::iterator it = other_fields.begin();
        it != other_fields.end(); it++) {
diff --git a/cpp/test/null_storage_test.cc b/cpp/test/null_storage_test.cc
index 8284554..3669ea9 100644
--- a/cpp/test/null_storage_test.cc
+++ b/cpp/test/null_storage_test.cc
@@ -36,8 +36,6 @@
   NullStorageTest()
       : data_ready_(BuildCallback(this, &NullStorageTest::OnDataReady)) {}
 
-  virtual ~NullStorageTest() {}
-
   NullStorage storage_;
   bool success_;
   std::string key_;
diff --git a/cpp/test/preload_supplier_test.cc b/cpp/test/preload_supplier_test.cc
index bf04a85..8612e98 100644
--- a/cpp/test/preload_supplier_test.cc
+++ b/cpp/test/preload_supplier_test.cc
@@ -46,8 +46,6 @@
       : supplier_(new TestdataSource(true), new NullStorage),
         loaded_callback_(BuildCallback(this, &PreloadSupplierTest::OnLoaded)) {}
 
-  virtual ~PreloadSupplierTest() {}
-
   PreloadSupplier supplier_;
   const scoped_ptr<const PreloadSupplier::Callback> loaded_callback_;
 
diff --git a/cpp/test/region_data_builder_test.cc b/cpp/test/region_data_builder_test.cc
index a60189f..fe2f2e1 100644
--- a/cpp/test/region_data_builder_test.cc
+++ b/cpp/test/region_data_builder_test.cc
@@ -46,8 +46,6 @@
         loaded_callback_(BuildCallback(this, &RegionDataBuilderTest::OnLoaded)),
         best_language_() {}
 
-  virtual ~RegionDataBuilderTest() {}
-
   PreloadSupplier supplier_;
   RegionDataBuilder builder_;
   const scoped_ptr<const PreloadSupplier::Callback> loaded_callback_;
diff --git a/cpp/test/region_data_constants_test.cc b/cpp/test/region_data_constants_test.cc
index 8942445..63e6ae2 100644
--- a/cpp/test/region_data_constants_test.cc
+++ b/cpp/test/region_data_constants_test.cc
@@ -14,6 +14,8 @@
 
 #include "region_data_constants.h"
 
+#include <libaddressinput/util/basictypes.h>
+
 #include <string>
 
 #include <gtest/gtest.h>
@@ -23,7 +25,13 @@
 using i18n::addressinput::RegionDataConstants;
 
 // Tests for region codes, for example "ZA".
-class RegionCodeTest : public testing::TestWithParam<std::string> {};
+class RegionCodeTest : public testing::TestWithParam<std::string> {
+ protected:
+  RegionCodeTest() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(RegionCodeTest);
+};
 
 // Verifies that a region code consists of two characters, for example "ZA".
 TEST_P(RegionCodeTest, RegionCodeHasTwoCharacters) {
@@ -57,9 +65,14 @@
 // Tests for region data, for example "{\"fmt\":\"%C%S\"}".
 class RegionDataTest : public testing::TestWithParam<std::string> {
  protected:
+  RegionDataTest() {}
+
   const std::string& GetData() const {
     return RegionDataConstants::GetRegionData(GetParam());
   }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(RegionDataTest);
 };
 
 // Verifies that a region data value begins with '{' and end with '}', for
diff --git a/cpp/test/retriever_test.cc b/cpp/test/retriever_test.cc
index 5b884b0..00c2ea4 100644
--- a/cpp/test/retriever_test.cc
+++ b/cpp/test/retriever_test.cc
@@ -65,8 +65,6 @@
         data_(),
         data_ready_(BuildCallback(this, &RetrieverTest::OnDataReady)) {}
 
-  virtual ~RetrieverTest() {}
-
   Retriever retriever_;
   bool success_;
   std::string key_;
diff --git a/cpp/test/rule_retriever_test.cc b/cpp/test/rule_retriever_test.cc
index 656b23b..ecf3af7 100644
--- a/cpp/test/rule_retriever_test.cc
+++ b/cpp/test/rule_retriever_test.cc
@@ -48,8 +48,6 @@
         rule_(),
         rule_ready_(BuildCallback(this, &RuleRetrieverTest::OnRuleReady)) {}
 
-  virtual ~RuleRetrieverTest() {}
-
   RuleRetriever rule_retriever_;
   bool success_;
   std::string key_;
diff --git a/cpp/test/rule_test.cc b/cpp/test/rule_test.cc
index c291cfd..7c5a0c5 100644
--- a/cpp/test/rule_test.cc
+++ b/cpp/test/rule_test.cc
@@ -16,6 +16,7 @@
 
 #include <libaddressinput/address_field.h>
 #include <libaddressinput/localization.h>
+#include <libaddressinput/util/basictypes.h>
 
 #include <cstddef>
 #include <string>
@@ -241,7 +242,11 @@
 class PostalCodeNameParseTest
     : public testing::TestWithParam<std::pair<std::string, int> > {
  protected:
+  PostalCodeNameParseTest() {}
   Rule rule_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(PostalCodeNameParseTest);
 };
 
 // Verifies that a postal code name is parsed correctly.
@@ -263,7 +268,11 @@
 class AdminAreaNameParseTest
     : public testing::TestWithParam<std::pair<std::string, int> > {
  protected:
+  AdminAreaNameParseTest() {}
   Rule rule_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(AdminAreaNameParseTest);
 };
 
 // Verifies that an administrative area name is parsed correctly.
@@ -302,6 +311,8 @@
 // Tests for rule parsing.
 class RuleParseTest : public testing::TestWithParam<std::string> {
  protected:
+  RuleParseTest() {}
+
   const std::string& GetRegionData() const {
     // GetParam() is either a region code or the region data itself.
     // RegionDataContants::GetRegionData() returns an empty string for anything
@@ -312,6 +323,9 @@
 
   Rule rule_;
   Localization localization_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(RuleParseTest);
 };
 
 // Verifies that a region data can be parsed successfully.
diff --git a/cpp/test/supplier_test.cc b/cpp/test/supplier_test.cc
index bb783db..e55c0c1 100644
--- a/cpp/test/supplier_test.cc
+++ b/cpp/test/supplier_test.cc
@@ -73,8 +73,6 @@
  public:
   static SupplierWrapper* Build() { return new OndemandSupplierWrapper; }
 
-  virtual ~OndemandSupplierWrapper() {}
-
   virtual void Supply(const LookupKey& lookup_key,
                       const Supplier::Callback& supplied) {
     ondemand_supplier_.Supply(lookup_key, supplied);
@@ -92,8 +90,6 @@
  public:
   static SupplierWrapper* Build() { return new PreloadSupplierWrapper; }
 
-  virtual ~PreloadSupplierWrapper() {}
-
   virtual void Supply(const LookupKey& lookup_key,
                       const Supplier::Callback& supplied) {
     const std::string& region_code = lookup_key.GetRegionCode();
@@ -125,8 +121,6 @@
         supplier_wrapper_((*GetParam())()),
         supplied_(BuildCallback(this, &SupplierTest::Supplied)) {}
 
-  virtual ~SupplierTest() {}
-
   void Supply() {
     lookup_key_.FromAddress(address_);
     supplier_wrapper_->Supply(lookup_key_, *supplied_);
diff --git a/cpp/test/testdata_source_test.cc b/cpp/test/testdata_source_test.cc
index 095b503..58468a9 100644
--- a/cpp/test/testdata_source_test.cc
+++ b/cpp/test/testdata_source_test.cc
@@ -45,8 +45,6 @@
         data_(),
         data_ready_(BuildCallback(this, &TestdataSourceTest::OnDataReady)) {}
 
-  virtual ~TestdataSourceTest() {}
-
   TestdataSource source_;
   TestdataSource aggregate_source_;
   bool success_;
diff --git a/cpp/test/util/string_compare_test.cc b/cpp/test/util/string_compare_test.cc
index cad36c1..b35b7df 100644
--- a/cpp/test/util/string_compare_test.cc
+++ b/cpp/test/util/string_compare_test.cc
@@ -14,6 +14,8 @@
 
 #include "util/string_compare.h"
 
+#include <libaddressinput/util/basictypes.h>
+
 #include <string>
 
 #include <gtest/gtest.h>
@@ -42,7 +44,11 @@
 
 class StringCompareTest : public testing::TestWithParam<TestCase> {
  protected:
+  StringCompareTest() {}
   StringCompare compare_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(StringCompareTest);
 };
 
 TEST_P(StringCompareTest, CorrectComparison) {
diff --git a/cpp/test/validating_storage_test.cc b/cpp/test/validating_storage_test.cc
index 36f85d9..3c8aa53 100644
--- a/cpp/test/validating_storage_test.cc
+++ b/cpp/test/validating_storage_test.cc
@@ -56,8 +56,6 @@
         data_(),
         data_ready_(BuildCallback(this, &ValidatingStorageTest::OnDataReady)) {}
 
-  virtual ~ValidatingStorageTest() {}
-
   Storage* const wrapped_storage_;  // Owned by |storage_|.
   ValidatingStorage storage_;
   bool success_;
diff --git a/cpp/test/validation_task_test.cc b/cpp/test/validation_task_test.cc
index e3900bd..9caf996 100644
--- a/cpp/test/validation_task_test.cc
+++ b/cpp/test/validation_task_test.cc
@@ -57,6 +57,7 @@
       SORTING_CODE,
       POSTAL_CODE,
       STREET_ADDRESS,
+      ORGANIZATION,
       RECIPIENT
     };
 
@@ -83,8 +84,6 @@
     filter_.insert(std::make_pair(RECIPIENT, MISSING_REQUIRED_FIELD));
   }
 
-  virtual ~ValidationTaskTest() {}
-
   void Validate() {
     Rule rule[arraysize(json_)];
 
@@ -215,12 +214,14 @@
   address_.locality = "ccc";
   address_.postal_code = "zzz";
   address_.address_line.push_back("aaa");
+  address_.organization = "ooo";
   address_.recipient = "nnn";
 
   filter_.insert(std::make_pair(ADMIN_AREA, MISSING_REQUIRED_FIELD));
   filter_.insert(std::make_pair(LOCALITY, MISSING_REQUIRED_FIELD));
   filter_.insert(std::make_pair(POSTAL_CODE, MISSING_REQUIRED_FIELD));
   filter_.insert(std::make_pair(STREET_ADDRESS, MISSING_REQUIRED_FIELD));
+  filter_.insert(std::make_pair(ORGANIZATION, MISSING_REQUIRED_FIELD));
 
   ASSERT_NO_FATAL_FAILURE(Validate());
   ASSERT_TRUE(called_);
diff --git a/java/src/com/android/i18n/addressinput/AddressField.java b/java/src/com/android/i18n/addressinput/AddressField.java
index b951021..17b1817 100644
--- a/java/src/com/android/i18n/addressinput/AddressField.java
+++ b/java/src/com/android/i18n/addressinput/AddressField.java
@@ -24,14 +24,14 @@
  * formatting. Note that the metadata also has a character for newlines, which is not defined here.
  */
 public enum AddressField {
-    ADMIN_AREA('S', "state"),
-    LOCALITY('C', "city"),
-    RECIPIENT('N', "name"),
-    ORGANIZATION('O', "organization"),
+    ADMIN_AREA('S'),
+    LOCALITY('C'),
+    RECIPIENT('N'),
+    ORGANIZATION('O'),
     // Deprecated - use A instead.
-    ADDRESS_LINE_1('1', "street1"),
+    ADDRESS_LINE_1('1'),
     // Deprecated - use A instead.
-    ADDRESS_LINE_2('2', "street2"),
+    ADDRESS_LINE_2('2'),
     DEPENDENT_LOCALITY('D'),
     POSTAL_CODE('Z'),
     SORTING_CODE('X'),
@@ -58,15 +58,8 @@
 
     private final char mField;
 
-    private final String mAttributeName;
-
-    private AddressField(char field, String attributeName) {
-        mField = field;
-        mAttributeName = attributeName;
-    }
-
     private AddressField(char field) {
-        this(field, null);
+        mField = field;
     }
 
     /**
@@ -78,17 +71,6 @@
     }
 
     /**
-     * Gets attribute name. Attribute names are used as keys to JSON address data returned from the
-     * server. Returns null if the field does not have a corresponding attribute name.
-     *
-     * Note: Not all address fields have attribute names. Fields like postal code, country, sorting
-     * code, or street address do not have attribute names.
-     */
-    String getAttributeName() {
-        return mAttributeName;
-    }
-
-    /**
      * Gets the field's identification character, as used in the metadata.
      *
      * @return identification char.
diff --git a/java/test/com/android/i18n/addressinput/AddressFieldTest.java b/java/test/com/android/i18n/addressinput/AddressFieldTest.java
index 3419097..aa0a741 100644
--- a/java/test/com/android/i18n/addressinput/AddressFieldTest.java
+++ b/java/test/com/android/i18n/addressinput/AddressFieldTest.java
@@ -30,8 +30,4 @@
     public void testGetChar() throws Exception {
         assertEquals('R', AddressField.COUNTRY.getChar());
     }
-
-    public void testGetAttributeName() throws Exception {
-        assertEquals("name", AddressField.RECIPIENT.getAttributeName());
-    }
 }