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 <nacl_io/nacl_io.h> | 7 #include <nacl_io/nacl_io.h> |
8 #include <sys/mount.h> | 8 #include <sys/mount.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 const webrtc::DesktopRect& rect = i.rect(); | 353 const webrtc::DesktopRect& rect = i.rect(); |
354 std::unique_ptr<base::ListValue> rect_value(new base::ListValue()); | 354 std::unique_ptr<base::ListValue> rect_value(new base::ListValue()); |
355 rect_value->AppendInteger(rect.left()); | 355 rect_value->AppendInteger(rect.left()); |
356 rect_value->AppendInteger(rect.top()); | 356 rect_value->AppendInteger(rect.top()); |
357 rect_value->AppendInteger(rect.width()); | 357 rect_value->AppendInteger(rect.width()); |
358 rect_value->AppendInteger(rect.height()); | 358 rect_value->AppendInteger(rect.height()); |
359 rects_value->Append(std::move(rect_value)); | 359 rects_value->Append(std::move(rect_value)); |
360 } | 360 } |
361 | 361 |
362 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 362 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
363 data->Set("rects", rects_value.release()); | 363 data->Set("rects", std::move(rects_value)); |
364 PostLegacyJsonMessage("onDebugRegion", std::move(data)); | 364 PostLegacyJsonMessage("onDebugRegion", std::move(data)); |
365 } | 365 } |
366 | 366 |
367 void ChromotingInstance::OnConnectionState( | 367 void ChromotingInstance::OnConnectionState( |
368 protocol::ConnectionToHost::State state, | 368 protocol::ConnectionToHost::State state, |
369 protocol::ErrorCode error) { | 369 protocol::ErrorCode error) { |
370 pp::UMAPrivate uma(this); | 370 pp::UMAPrivate uma(this); |
371 | 371 |
372 switch (state) { | 372 switch (state) { |
373 case protocol::ConnectionToHost::INITIALIZING: | 373 case protocol::ConnectionToHost::INITIALIZING: |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 message.Set(pp::Var("method"), pp::Var(method)); | 995 message.Set(pp::Var("method"), pp::Var(method)); |
996 message.Set(pp::Var("data"), data); | 996 message.Set(pp::Var("data"), data); |
997 PostMessage(message); | 997 PostMessage(message); |
998 } | 998 } |
999 | 999 |
1000 void ChromotingInstance::PostLegacyJsonMessage( | 1000 void ChromotingInstance::PostLegacyJsonMessage( |
1001 const std::string& method, | 1001 const std::string& method, |
1002 std::unique_ptr<base::DictionaryValue> data) { | 1002 std::unique_ptr<base::DictionaryValue> data) { |
1003 base::DictionaryValue message; | 1003 base::DictionaryValue message; |
1004 message.SetString("method", method); | 1004 message.SetString("method", method); |
1005 message.Set("data", data.release()); | 1005 message.Set("data", std::move(data)); |
1006 | 1006 |
1007 std::string message_json; | 1007 std::string message_json; |
1008 base::JSONWriter::Write(message, &message_json); | 1008 base::JSONWriter::Write(message, &message_json); |
1009 PostMessage(pp::Var(message_json)); | 1009 PostMessage(pp::Var(message_json)); |
1010 } | 1010 } |
1011 | 1011 |
1012 void ChromotingInstance::SendTrappedKey(uint32_t usb_keycode, bool pressed) { | 1012 void ChromotingInstance::SendTrappedKey(uint32_t usb_keycode, bool pressed) { |
1013 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 1013 std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
1014 data->SetInteger("usbKeycode", usb_keycode); | 1014 data->SetInteger("usbKeycode", usb_keycode); |
1015 data->SetBoolean("pressed", pressed); | 1015 data->SetBoolean("pressed", pressed); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 if (is_custom_counts_histogram) { | 1131 if (is_custom_counts_histogram) { |
1132 uma.HistogramCustomCounts(histogram_name, value, histogram_min, | 1132 uma.HistogramCustomCounts(histogram_name, value, histogram_min, |
1133 histogram_max, histogram_buckets); | 1133 histogram_max, histogram_buckets); |
1134 } else { | 1134 } else { |
1135 uma.HistogramCustomTimes(histogram_name, value, histogram_min, | 1135 uma.HistogramCustomTimes(histogram_name, value, histogram_min, |
1136 histogram_max, histogram_buckets); | 1136 histogram_max, histogram_buckets); |
1137 } | 1137 } |
1138 } | 1138 } |
1139 | 1139 |
1140 } // namespace remoting | 1140 } // namespace remoting |
OLD | NEW |