| 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 #ifndef CONTENT_RENDERER_WEB_UI_BINDINGS_H_ | 5 #ifndef CONTENT_RENDERER_WEB_UI_BINDINGS_H_ |
| 6 #define CONTENT_RENDERER_WEB_UI_BINDINGS_H_ | 6 #define CONTENT_RENDERER_WEB_UI_BINDINGS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_sender.h" |
| 11 #include "webkit/glue/cpp_bound_class.h" | 11 #include "webkit/glue/cpp_bound_class.h" |
| 12 | 12 |
| 13 // A DOMBoundBrowserObject is a backing for some object bound to the window | 13 // A DOMBoundBrowserObject is a backing for some object bound to the window |
| 14 // in JS that knows how to dispatch messages to an associated c++ object living | 14 // in JS that knows how to dispatch messages to an associated c++ object living |
| 15 // in the browser process. | 15 // in the browser process. |
| 16 class DOMBoundBrowserObject : public webkit_glue::CppBoundClass { | 16 class DOMBoundBrowserObject : public webkit_glue::CppBoundClass { |
| 17 public: | 17 public: |
| 18 CONTENT_EXPORT DOMBoundBrowserObject(); | 18 CONTENT_EXPORT DOMBoundBrowserObject(); |
| 19 CONTENT_EXPORT virtual ~DOMBoundBrowserObject(); | 19 CONTENT_EXPORT virtual ~DOMBoundBrowserObject(); |
| 20 | 20 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // WebUIBindings is the class backing the "chrome" object accessible | 33 // WebUIBindings is the class backing the "chrome" object accessible |
| 34 // from Javascript from privileged pages. | 34 // from Javascript from privileged pages. |
| 35 // | 35 // |
| 36 // We expose one function, for sending a message to the browser: | 36 // We expose one function, for sending a message to the browser: |
| 37 // send(String name, Object argument); | 37 // send(String name, Object argument); |
| 38 // It's plumbed through to the OnWebUIMessage callback on RenderViewHost | 38 // It's plumbed through to the OnWebUIMessage callback on RenderViewHost |
| 39 // delegate. | 39 // delegate. |
| 40 class WebUIBindings : public DOMBoundBrowserObject { | 40 class WebUIBindings : public DOMBoundBrowserObject { |
| 41 public: | 41 public: |
| 42 WebUIBindings(IPC::Message::Sender* sender, | 42 WebUIBindings(IPC::Sender* sender, int routing_id); |
| 43 int routing_id); | |
| 44 virtual ~WebUIBindings(); | 43 virtual ~WebUIBindings(); |
| 45 | 44 |
| 46 private: | 45 private: |
| 47 // The send() function provided to Javascript. | 46 // The send() function provided to Javascript. |
| 48 void Send(const webkit_glue::CppArgumentList& args, | 47 void Send(const webkit_glue::CppArgumentList& args, |
| 49 webkit_glue::CppVariant* result); | 48 webkit_glue::CppVariant* result); |
| 50 | 49 |
| 51 IPC::Message::Sender* sender_; | 50 IPC::Sender* sender_; |
| 52 int routing_id_; | 51 int routing_id_; |
| 53 | 52 |
| 54 DISALLOW_COPY_AND_ASSIGN(WebUIBindings); | 53 DISALLOW_COPY_AND_ASSIGN(WebUIBindings); |
| 55 }; | 54 }; |
| 56 | 55 |
| 57 #endif // CONTENT_RENDERER_WEB_UI_BINDINGS_H_ | 56 #endif // CONTENT_RENDERER_WEB_UI_BINDINGS_H_ |
| OLD | NEW |