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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // Protocol buffer definitions for the user's contacts.
6
7 syntax = "proto2";
8
9 option optimize_for = LITE_RUNTIME;
10
11 package contacts;
12
13 // A contact, roughly based on the GData Contact kind:
14 // https://developers.google.com/gdata/docs/2.0/elements#gdContactKind
15 // All strings are UTF-8.
16 message Contact {
17 // Next ID to use: 15
18
19 // Provider-assigned unique identifier.
20 optional string provider_id = 1;
21
22 // Last time at which this contact was updated within the upstream provider.
23 optional int64 update_time = 2;
24
25 // Has the contact been deleted recently within the upstream provider?
26 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
27
28 // Taken from https://developers.google.com/gdata/docs/2.0/elements#gdName.
29 optional string full_name = 4;
30 optional string given_name = 5;
31 optional string additional_name = 6;
32 optional string family_name = 7;
33 optional string name_prefix = 8;
34 optional string name_suffix = 9;
35
36 // PNG-encoded photo (which can safely be decoded to a bitmap outside of a
37 // sandbox). Unset if no photo is available.
38 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
39
40 // Describes an address-like message's type.
41 message AddressType {
42 // Next ID to use: 3
43 enum Relation {
44 HOME = 0;
45 WORK = 1;
46 MOBILE = 2;
47 OTHER = 3;
48 }
49 optional Relation relation = 1 [default = OTHER];
50 optional string label = 2;
51 }
52
53 message EmailAddress {
54 // Next ID to use: 4
55 optional string address = 1;
56 optional AddressType type = 2;
57 optional bool primary = 3 [default = false];
58 }
59 repeated EmailAddress email_addresses = 11;
60
61 message PhoneNumber {
62 // Next ID to use: 4
63 optional string number = 1;
64 optional AddressType type = 2;
65 optional bool primary = 3 [default = false];
66 }
67 repeated PhoneNumber phone_numbers = 12;
68
69 message PostalAddress {
70 // Next ID to use: 4
71 optional string address = 1;
72 optional AddressType type = 2;
73 optional bool primary = 3 [default = false];
74 }
75 repeated PostalAddress postal_addresses = 13;
76
77 message InstantMessagingAddress {
78 // Next ID to use: 5
79 optional string address = 1;
80 // Taken from https://developers.google.com/gdata/docs/2.0/elements#gdIm.
81 enum Protocol {
82 AIM = 0;
83 MSN = 1;
84 YAHOO = 2;
85 SKYPE = 3;
86 QQ = 4;
87 GOOGLE_TALK = 5;
88 ICQ = 6;
89 JABBER = 7;
90 OTHER = 8;
91 }
92 optional Protocol protocol = 2 [default = OTHER];
93 optional AddressType type = 3;
94 optional bool primary = 4 [default = false];
95 }
96 repeated InstantMessagingAddress instant_messaging_addresses = 14;
97 }
OLDNEW
« 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