OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 27 matching lines...) Expand all Loading... | |
38 // Called to update |use_count_| and |use_date_| when this data model is | 38 // Called to update |use_count_| and |use_date_| when this data model is |
39 // the subject of user interaction (usually, when it's used to fill a form). | 39 // the subject of user interaction (usually, when it's used to fill a form). |
40 void RecordUse(); | 40 void RecordUse(); |
41 | 41 |
42 std::string guid() const { return guid_; } | 42 std::string guid() const { return guid_; } |
43 void set_guid(const std::string& guid) { guid_ = guid; } | 43 void set_guid(const std::string& guid) { guid_ = guid; } |
44 | 44 |
45 std::string origin() const { return origin_; } | 45 std::string origin() const { return origin_; } |
46 void set_origin(const std::string& origin) { origin_ = origin; } | 46 void set_origin(const std::string& origin) { origin_ = origin; } |
47 | 47 |
48 const std::string& server_id() const { return server_id_; } | |
49 void set_server_id(const std::string& server_id) { server_id_ = server_id; } | |
Evan Stade
2015/05/18 22:02:59
can you make this protected
please use gerrit instead
2015/05/20 20:04:55
No longer applicable as we decided to go without t
| |
50 | |
48 size_t use_count() const { return use_count_; } | 51 size_t use_count() const { return use_count_; } |
49 void set_use_count(size_t count) { use_count_ = count; } | 52 void set_use_count(size_t count) { use_count_ = count; } |
50 | 53 |
51 const base::Time& use_date() const { return use_date_; } | 54 const base::Time& use_date() const { return use_date_; } |
52 void set_use_date(const base::Time& time) { use_date_ = time; } | 55 void set_use_date(const base::Time& time) { use_date_ = time; } |
53 | 56 |
54 const base::Time& modification_date() const { return modification_date_; } | 57 const base::Time& modification_date() const { return modification_date_; } |
55 // This should only be called from database code. | 58 // This should only be called from database code. |
56 void set_modification_date(const base::Time& time) { | 59 void set_modification_date(const base::Time& time) { |
57 modification_date_ = time; | 60 modification_date_ = time; |
58 } | 61 } |
59 | 62 |
60 private: | 63 private: |
61 // A globally unique ID for this object. | 64 // A globally unique ID for this object. |
62 std::string guid_; | 65 std::string guid_; |
63 | 66 |
64 // The origin of this data. This should be | 67 // The origin of this data. This should be |
65 // (a) a web URL for the domain of the form from which the data was | 68 // (a) a web URL for the domain of the form from which the data was |
66 // automatically aggregated, e.g. https://www.example.com/register, | 69 // automatically aggregated, e.g. https://www.example.com/register, |
67 // (b) some other non-empty string, which cannot be interpreted as a web | 70 // (b) some other non-empty string, which cannot be interpreted as a web |
68 // URL, identifying the origin for non-aggregated data, or | 71 // URL, identifying the origin for non-aggregated data, or |
69 // (c) an empty string, indicating that the origin for this data is unknown. | 72 // (c) an empty string, indicating that the origin for this data is unknown. |
70 std::string origin_; | 73 std::string origin_; |
71 | 74 |
75 // An identifeir used for identifying server data. Only set for | |
76 // SERVER_PROFILEs, MASKED_SERVER_CARDs, and FULL_SERVER_CARDs. If the server | |
77 // does not provide this data, then this is a hash of contents. | |
78 std::string server_id_; | |
79 | |
72 // The number of times this model has been used. | 80 // The number of times this model has been used. |
73 size_t use_count_; | 81 size_t use_count_; |
74 | 82 |
75 // The last time the model was used. | 83 // The last time the model was used. |
76 base::Time use_date_; | 84 base::Time use_date_; |
77 | 85 |
78 // The last time data in the model was modified. | 86 // The last time data in the model was modified. |
79 base::Time modification_date_; | 87 base::Time modification_date_; |
80 }; | 88 }; |
81 | 89 |
82 } // namespace autofill | 90 } // namespace autofill |
83 | 91 |
84 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_ | 92 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_ |
OLD | NEW |