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

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: Changes from Dane's 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..1fe51a0f1bee29f7438827fad5aff67a18deb5e3
--- /dev/null
+++ b/chrome/browser/autofill/wallet/wallet_address.h
@@ -0,0 +1,97 @@
+// 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 {
+ public:
+ Address();
+ // TODO(ahutter): do we need descriptive_name, is_post_box,
+ // is_minimal_address, is_valid, or is_default
Raman Kakilate 2012/11/17 02:28:31 we need is_minimal_address for upgrade flow ? an
ahutter 2012/11/27 00:46:12 It's part of the response so we're ok there. I'm
+ 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,
Raman Kakilate 2012/11/17 02:28:31 extra space before "postal_.."
ahutter 2012/11/27 00:46:12 Done.
+ const std::string& phone_number,
+ const std::string& object_id);
+ ~Address();
+ const std::string get_country_name_code() const { return country_name_code_; }
benquan 2012/12/15 02:48:59 should const getters return const references?
ahutter 2012/12/17 17:23:02 They do in the most recent CL.
+ 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) {
Raman Kakilate 2012/11/17 02:28:31 optional: %s/object_id/address_id ?
Raman Kakilate 2012/11/17 04:10:51 Ah .. ok. object_id is name used within API itself
ahutter 2012/11/27 00:46:12 ack.
ahutter 2012/11/27 00:46:12 ack.
+ object_id_ = object_id;
+ }
+
+ static Address* CreateFromIdedDictionary(
Raman Kakilate 2012/11/17 02:28:31 Create and Dictionary doesn't seem to go well toge
ahutter 2012/11/27 00:46:12 Done.
+ base::DictionaryValue* dictionary);
+ static Address* CreateFromDisplayDictionary(
+ 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