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

Unified Diff: chrome/browser/chromeos/contacts/contact.proto

Issue 10830052: chromeos: Use protocol buffers for Contact class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 8 years, 5 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
« no previous file with comments | « chrome/browser/chromeos/contacts/contact.cc ('k') | chrome/browser/chromeos/contacts/contact_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/contacts/contact.proto
diff --git a/chrome/browser/chromeos/contacts/contact.proto b/chrome/browser/chromeos/contacts/contact.proto
new file mode 100644
index 0000000000000000000000000000000000000000..ba2738e76571990778378d45e51c8e01e2f7a644
--- /dev/null
+++ b/chrome/browser/chromeos/contacts/contact.proto
@@ -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.
+//
+// Protocol buffer definitions for the user's contacts.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package contacts;
+
+// A contact, roughly based on the GData Contact kind:
+// https://developers.google.com/gdata/docs/2.0/elements#gdContactKind
+// All strings are UTF-8.
+message Contact {
+ // Next ID to use: 15
+
+ // Provider-assigned unique identifier.
+ optional string provider_id = 1;
+
+ // Last time at which this contact was updated within the upstream provider.
+ optional int64 update_time = 2;
+
+ // Has the contact been deleted recently within the upstream provider?
+ optional bool deleted = 3 [default = false];
Daniel Erat 2012/07/27 18:44:05 (I know that false is the default, but I think tha
+
+ // Taken from https://developers.google.com/gdata/docs/2.0/elements#gdName.
+ optional string full_name = 4;
+ optional string given_name = 5;
+ optional string additional_name = 6;
+ optional string family_name = 7;
+ optional string name_prefix = 8;
+ optional string name_suffix = 9;
+
+ // PNG-encoded photo (which can safely be decoded to a bitmap outside of a
+ // sandbox). Unset if no photo is available.
+ optional bytes png_photo = 10;
Daniel Erat 2012/07/27 20:04:07 I'm still going back and forth on this. Using a t
satorux1 2012/07/27 20:46:33 Storing the original data makes sense. You might w
Daniel Erat 2012/07/27 21:59:01 Okay, I've switched to storing the original data a
+
+ // Describes an address-like message's type.
+ message AddressType {
+ // Next ID to use: 3
+ enum Relation {
+ HOME = 0;
+ WORK = 1;
+ MOBILE = 2;
+ OTHER = 3;
+ }
+ optional Relation relation = 1 [default = OTHER];
+ optional string label = 2;
+ }
+
+ message EmailAddress {
+ // Next ID to use: 4
+ optional string address = 1;
+ optional AddressType type = 2;
+ optional bool primary = 3 [default = false];
+ }
+ repeated EmailAddress email_addresses = 11;
+
+ message PhoneNumber {
+ // Next ID to use: 4
+ optional string number = 1;
+ optional AddressType type = 2;
+ optional bool primary = 3 [default = false];
+ }
+ repeated PhoneNumber phone_numbers = 12;
+
+ message PostalAddress {
+ // Next ID to use: 4
+ optional string address = 1;
+ optional AddressType type = 2;
+ optional bool primary = 3 [default = false];
+ }
+ repeated PostalAddress postal_addresses = 13;
+
+ message InstantMessagingAddress {
+ // Next ID to use: 5
+ optional string address = 1;
+ // Taken from https://developers.google.com/gdata/docs/2.0/elements#gdIm.
+ enum Protocol {
+ AIM = 0;
+ MSN = 1;
+ YAHOO = 2;
+ SKYPE = 3;
+ QQ = 4;
+ GOOGLE_TALK = 5;
+ ICQ = 6;
+ JABBER = 7;
+ OTHER = 8;
+ }
+ optional Protocol protocol = 2 [default = OTHER];
+ optional AddressType type = 3;
+ optional bool primary = 4 [default = false];
+ }
+ repeated InstantMessagingAddress instant_messaging_addresses = 14;
+}
« no previous file with comments | « chrome/browser/chromeos/contacts/contact.cc ('k') | chrome/browser/chromeos/contacts/contact_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698