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

Unified Diff: chrome/browser/autofill/wallet/wallet_address.h

Issue 11293078: Integrating Online Wallet into Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes from Raman's code review Created 8 years, 1 month 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: chrome/browser/autofill/wallet/wallet_address.h
diff --git a/chrome/browser/autofill/wallet/wallet_address.h b/chrome/browser/autofill/wallet/wallet_address.h
new file mode 100644
index 0000000000000000000000000000000000000000..1efa0fb9310bdb10a57df7eecbb42af95eede146
--- /dev/null
+++ b/chrome/browser/autofill/wallet/wallet_address.h
@@ -0,0 +1,99 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_
+#define CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace wallet {
+
+class Address {
Albert Bodenhamer 2012/11/30 01:06:02 Autofill has a class very similar to this in chrom
ahutter 2012/12/01 04:06:50 Added a TODO
+ public:
+ Address();
+ // TODO(ahutter): do we need descriptive_name, is_post_box,
+ // is_minimal_address, is_valid, or is_default
+ Address(const std::string& country_name_code,
+ const std::string& recipient_name,
+ const std::string& address_line_1,
+ const std::string& address_line_2,
+ const std::string& locality_name,
+ const std::string& administrative_area_name,
+ const std::string& postal_code_number,
+ const std::string& phone_number,
+ const std::string& object_id);
+ ~Address();
+ const std::string get_country_name_code() const { return country_name_code_; }
+ const std::string get_recipient_name() const { return recipient_name_; }
+ const std::string get_address_line_1() const { return address_line_1_; }
+ const std::string get_address_line_2() const { return address_line_2_; }
+ const std::string get_locality_name() const { return locality_name_; }
+ const std::string get_admin_area_name() const {
+ return administrative_area_name_;
+ }
+ const std::string get_postal_code_number() const {
+ return postal_code_number_;
+ }
+ const std::string get_phone_number() const { return phone_number_; }
+ const std::string get_object_id() const { return object_id_; }
+
+ void set_country_name_code(const std::string& country_name_code) {
+ country_name_code_ = country_name_code;
+ }
+ void set_recipient_name(const std::string& recipient_name) {
+ recipient_name_ = recipient_name;
+ }
+ void set_address_line_1(const std::string& address_line_1) {
+ address_line_1_ = address_line_1;
+ }
+ void set_address_line_2(const std::string& address_line_2) {
+ address_line_2_ = address_line_2;
+ }
+ void set_locality_name(const std::string& locality_name) {
+ locality_name_ = locality_name;
+ }
+ void set_admin_area_name(const std::string& administrative_area_name) {
+ administrative_area_name_ = administrative_area_name;
+ }
+ void set_postal_code_number(const std::string& postal_code_number) {
+ postal_code_number_ = postal_code_number;
+ }
+ void set_phone_number(const std::string& phone_number) {
+ phone_number_ = phone_number;
+ }
+ void set_object_id(const std::string& object_id) {
+ object_id_ = object_id;
+ }
+
+ // Returns null if input is invalid or a valid address that is selectable for
+ // Google Wallet use. Caller owns returned pointer.
+ static Address* CreateIdedAddress(base::DictionaryValue* dictionary);
+ // Returns null if input in invalid or a valid address that can only be used
+ // for displaying to the user. Caller owns returned pointer.
+ static Address* CreateDisplayAddress(base::DictionaryValue* dictionary);
+ bool operator==(const Address& other) const;
+ bool operator!=(const Address& other) const;
+
+ private:
+ std::string country_name_code_;
+ std::string recipient_name_;
+ std::string address_line_1_;
+ std::string address_line_2_;
+ std::string locality_name_;
+ std::string administrative_area_name_;
+ std::string postal_code_number_;
+ std::string phone_number_;
+ std::string object_id_;
+ DISALLOW_COPY_AND_ASSIGN(Address);
+};
+
+} // end wallet namespace
+
+#endif // CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_

Powered by Google App Engine
This is Rietveld 408576698