OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/safe_browsing/preference_validation_delegate.h" | 5 #include "chrome/browser/safe_browsing/preference_validation_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 !base::JSONWriter::Write(value, incident->mutable_atomic_value()))) { | 65 !base::JSONWriter::Write(value, incident->mutable_atomic_value()))) { |
66 incident->clear_atomic_value(); | 66 incident->clear_atomic_value(); |
67 } | 67 } |
68 incident->set_value_state(proto_value_state); | 68 incident->set_value_state(proto_value_state); |
69 add_incident_.Run(incident_data.Pass()); | 69 add_incident_.Run(incident_data.Pass()); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 void PreferenceValidationDelegate::OnSplitPreferenceValidation( | 73 void PreferenceValidationDelegate::OnSplitPreferenceValidation( |
74 const std::string& pref_path, | 74 const std::string& pref_path, |
75 const base::DictionaryValue* dict_value, | 75 const base::DictionaryValue* /* dict_value */, |
76 const std::vector<std::string>& invalid_keys, | 76 const std::vector<std::string>& invalid_keys, |
77 PrefHashStoreTransaction::ValueState value_state, | 77 PrefHashStoreTransaction::ValueState value_state, |
78 TrackedPreferenceHelper::ResetAction /* reset_action */) { | 78 TrackedPreferenceHelper::ResetAction /* reset_action */) { |
79 TPIncident_ValueState proto_value_state = MapValueState(value_state); | 79 TPIncident_ValueState proto_value_state = MapValueState(value_state); |
80 if (proto_value_state != TPIncident::UNKNOWN) { | 80 if (proto_value_state != TPIncident::UNKNOWN) { |
81 scoped_ptr<ClientIncidentReport_IncidentData> incident_data( | 81 scoped_ptr<ClientIncidentReport_IncidentData> incident_data( |
82 new ClientIncidentReport_IncidentData()); | 82 new ClientIncidentReport_IncidentData()); |
83 TPIncident* incident = incident_data->mutable_tracked_preference(); | 83 TPIncident* incident = incident_data->mutable_tracked_preference(); |
84 incident->set_path(pref_path); | 84 incident->set_path(pref_path); |
85 for (std::vector<std::string>::const_iterator scan(invalid_keys.begin()); | 85 for (std::vector<std::string>::const_iterator scan(invalid_keys.begin()); |
86 scan != invalid_keys.end(); | 86 scan != invalid_keys.end(); |
87 ++scan) { | 87 ++scan) { |
88 incident->add_split_key(*scan); | 88 incident->add_split_key(*scan); |
89 } | 89 } |
90 incident->set_value_state(proto_value_state); | 90 incident->set_value_state(proto_value_state); |
91 add_incident_.Run(incident_data.Pass()); | 91 add_incident_.Run(incident_data.Pass()); |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 } // namespace safe_browsing | 95 } // namespace safe_browsing |
OLD | NEW |