~osomon/oxide/i18n

« back to all changes in this revision

Viewing changes to qt/core/glue/oxide_qt_web_frame_adapter.cc

  • Committer: Olivier Tilloy
  • Date: 2014-04-08 10:03:11 UTC
  • mfrom: (312.2.173 oxide)
  • Revision ID: olivier.tilloy@canonical.com-20140408100311-b3zb7q1jfrevbrf1
Merge the latest changes from trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17
17
 
18
18
#include "oxide_qt_web_frame_adapter.h"
19
 
#include "oxide_qt_web_frame_adapter_p.h"
20
19
 
21
20
#include <QJsonDocument>
22
21
#include <QString>
31
30
namespace oxide {
32
31
namespace qt {
33
32
 
34
 
WebFrameAdapterPrivate::WebFrameAdapterPrivate() :
35
 
    owner(NULL) {}
36
 
 
37
 
WebFrameAdapterPrivate::~WebFrameAdapterPrivate() {}
38
 
 
39
 
// static
40
 
WebFrameAdapterPrivate* WebFrameAdapterPrivate::get(WebFrameAdapter* adapter) {
41
 
  return adapter->priv.data();
42
 
}
43
 
 
44
33
WebFrameAdapter::WebFrameAdapter(QObject* q) :
45
34
    AdapterBase(q),
46
 
    priv(new WebFrameAdapterPrivate()) {}
 
35
    owner_(NULL) {}
47
36
 
48
37
WebFrameAdapter::~WebFrameAdapter() {}
49
38
 
50
39
QUrl WebFrameAdapter::url() const {
51
 
  return QUrl(QString::fromStdString(priv->owner->url().spec()));
 
40
  return QUrl(QString::fromStdString(owner_->GetURL().spec()));
52
41
}
53
42
 
54
43
bool WebFrameAdapter::sendMessage(const QUrl& context,
58
47
  QJsonDocument jsondoc(QJsonDocument::fromVariant(args));
59
48
 
60
49
  oxide::ScriptMessageRequestImplBrowser* smrib =
61
 
      priv->owner->SendMessage(GURL(context.toString().toStdString()),
62
 
                               msg_id.toStdString(),
63
 
                               QString(jsondoc.toJson()).toStdString());
 
50
      owner_->SendMessage(GURL(context.toString().toStdString()),
 
51
                          msg_id.toStdString(),
 
52
                          QString(jsondoc.toJson()).toStdString());
64
53
  if (!smrib) {
65
54
    return false;
66
55
  }
75
64
                                         const QVariant& args) {
76
65
  QJsonDocument jsondoc(QJsonDocument::fromVariant(args));
77
66
 
78
 
  priv->owner->SendMessageNoReply(
 
67
  owner_->SendMessageNoReply(
79
68
      GURL(context.toString().toStdString()),
80
69
      msg_id.toStdString(),
81
70
      QString(jsondoc.toJson()).toStdString());