| 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 "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 } | 405 } |
| 406 | 406 |
| 407 void ChromotingInstance::PostChromotingMessage( | 407 void ChromotingInstance::PostChromotingMessage( |
| 408 const std::string& method, | 408 const std::string& method, |
| 409 scoped_ptr<base::DictionaryValue> data) { | 409 scoped_ptr<base::DictionaryValue> data) { |
| 410 scoped_ptr<base::DictionaryValue> message(new base::DictionaryValue()); | 410 scoped_ptr<base::DictionaryValue> message(new base::DictionaryValue()); |
| 411 message->SetString("method", method); | 411 message->SetString("method", method); |
| 412 message->Set("data", data.release()); | 412 message->Set("data", data.release()); |
| 413 | 413 |
| 414 std::string message_json; | 414 std::string message_json; |
| 415 base::JSONWriter::Write(message.get(), false, &message_json); | 415 base::JSONWriter::Write(message.get(), &message_json); |
| 416 PostMessage(pp::Var(message_json)); | 416 PostMessage(pp::Var(message_json)); |
| 417 } | 417 } |
| 418 | 418 |
| 419 void ChromotingInstance::SendOutgoingIq(const std::string& iq) { | 419 void ChromotingInstance::SendOutgoingIq(const std::string& iq) { |
| 420 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 420 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 421 data->SetString("iq", iq); | 421 data->SetString("iq", iq); |
| 422 PostChromotingMessage("sendOutgoingIq", data.Pass()); | 422 PostChromotingMessage("sendOutgoingIq", data.Pass()); |
| 423 | 423 |
| 424 GetScriptableObject()->SendIq(iq); | 424 GetScriptableObject()->SendIq(iq); |
| 425 } | 425 } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 539 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 540 data->SetString("message", message); | 540 data->SetString("message", message); |
| 541 PostChromotingMessage("logDebugMessage", data.Pass()); | 541 PostChromotingMessage("logDebugMessage", data.Pass()); |
| 542 | 542 |
| 543 scriptable_object->LogDebugInfo(message); | 543 scriptable_object->LogDebugInfo(message); |
| 544 } | 544 } |
| 545 g_logging_to_plugin = false; | 545 g_logging_to_plugin = false; |
| 546 } | 546 } |
| 547 | 547 |
| 548 } // namespace remoting | 548 } // namespace remoting |
| OLD | NEW |