OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "remoting/client/plugin/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include <nacl_io/nacl_io.h> | 10 #include <nacl_io/nacl_io.h> |
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 scoped_ptr<base::DictionaryValue> data) { | 1025 scoped_ptr<base::DictionaryValue> data) { |
1026 base::DictionaryValue message; | 1026 base::DictionaryValue message; |
1027 message.SetString("method", method); | 1027 message.SetString("method", method); |
1028 message.Set("data", data.release()); | 1028 message.Set("data", data.release()); |
1029 | 1029 |
1030 std::string message_json; | 1030 std::string message_json; |
1031 base::JSONWriter::Write(message, &message_json); | 1031 base::JSONWriter::Write(message, &message_json); |
1032 PostMessage(pp::Var(message_json)); | 1032 PostMessage(pp::Var(message_json)); |
1033 } | 1033 } |
1034 | 1034 |
1035 void ChromotingInstance::SendTrappedKey(uint32 usb_keycode, bool pressed) { | 1035 void ChromotingInstance::SendTrappedKey(uint32_t usb_keycode, bool pressed) { |
1036 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 1036 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
1037 data->SetInteger("usbKeycode", usb_keycode); | 1037 data->SetInteger("usbKeycode", usb_keycode); |
1038 data->SetBoolean("pressed", pressed); | 1038 data->SetBoolean("pressed", pressed); |
1039 PostLegacyJsonMessage("trappedKeyEvent", data.Pass()); | 1039 PostLegacyJsonMessage("trappedKeyEvent", data.Pass()); |
1040 } | 1040 } |
1041 | 1041 |
1042 void ChromotingInstance::SendOutgoingIq(const std::string& iq) { | 1042 void ChromotingInstance::SendOutgoingIq(const std::string& iq) { |
1043 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 1043 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
1044 data->SetString("iq", iq); | 1044 data->SetString("iq", iq); |
1045 PostLegacyJsonMessage("sendOutgoingIq", data.Pass()); | 1045 PostLegacyJsonMessage("sendOutgoingIq", data.Pass()); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 return false; | 1124 return false; |
1125 } | 1125 } |
1126 | 1126 |
1127 bool ChromotingInstance::IsConnected() { | 1127 bool ChromotingInstance::IsConnected() { |
1128 return client_ && | 1128 return client_ && |
1129 (client_->connection_state() == protocol::ConnectionToHost::CONNECTED); | 1129 (client_->connection_state() == protocol::ConnectionToHost::CONNECTED); |
1130 } | 1130 } |
1131 | 1131 |
1132 void ChromotingInstance::UpdateUmaEnumHistogram( | 1132 void ChromotingInstance::UpdateUmaEnumHistogram( |
1133 const std::string& histogram_name, | 1133 const std::string& histogram_name, |
1134 int64 value, | 1134 int64_t value, |
1135 int histogram_max) { | 1135 int histogram_max) { |
1136 pp::UMAPrivate uma(this); | 1136 pp::UMAPrivate uma(this); |
1137 uma.HistogramEnumeration(histogram_name, value, histogram_max); | 1137 uma.HistogramEnumeration(histogram_name, value, histogram_max); |
1138 } | 1138 } |
1139 | 1139 |
1140 void ChromotingInstance::UpdateUmaCustomHistogram( | 1140 void ChromotingInstance::UpdateUmaCustomHistogram( |
1141 bool is_custom_counts_histogram, | 1141 bool is_custom_counts_histogram, |
1142 const std::string& histogram_name, | 1142 const std::string& histogram_name, |
1143 int64 value, | 1143 int64_t value, |
1144 int histogram_min, | 1144 int histogram_min, |
1145 int histogram_max, | 1145 int histogram_max, |
1146 int histogram_buckets) { | 1146 int histogram_buckets) { |
1147 pp::UMAPrivate uma(this); | 1147 pp::UMAPrivate uma(this); |
1148 | 1148 |
1149 if (is_custom_counts_histogram) { | 1149 if (is_custom_counts_histogram) { |
1150 uma.HistogramCustomCounts(histogram_name, value, histogram_min, | 1150 uma.HistogramCustomCounts(histogram_name, value, histogram_min, |
1151 histogram_max, histogram_buckets); | 1151 histogram_max, histogram_buckets); |
1152 } else { | 1152 } else { |
1153 uma.HistogramCustomTimes(histogram_name, value, histogram_min, | 1153 uma.HistogramCustomTimes(histogram_name, value, histogram_min, |
1154 histogram_max, histogram_buckets); | 1154 histogram_max, histogram_buckets); |
1155 } | 1155 } |
1156 } | 1156 } |
1157 | 1157 |
1158 } // namespace remoting | 1158 } // namespace remoting |
OLD | NEW |