Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: chrome/renderer/external_host_bindings.h

Issue 63273002: Rename WebKit namespace to blink (part 4) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/external_extension.cc ('k') | chrome/renderer/external_host_bindings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_ 5 #ifndef CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_
6 #define CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_ 6 #define CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_
7 7
8 #include "ipc/ipc_sender.h" 8 #include "ipc/ipc_sender.h"
9 #include "webkit/renderer/cpp_bound_class.h" 9 #include "webkit/renderer/cpp_bound_class.h"
10 10
11 // ExternalHostBindings is the class backing the "externalHost" object 11 // ExternalHostBindings is the class backing the "externalHost" object
12 // accessible from Javascript 12 // accessible from Javascript
13 // 13 //
14 // We expose one function, for sending a message to the external host: 14 // We expose one function, for sending a message to the external host:
15 // postMessage(String message[, String target]); 15 // postMessage(String message[, String target]);
16 class ExternalHostBindings : public webkit_glue::CppBoundClass { 16 class ExternalHostBindings : public webkit_glue::CppBoundClass {
17 public: 17 public:
18 ExternalHostBindings(IPC::Sender* sender, int routing_id); 18 ExternalHostBindings(IPC::Sender* sender, int routing_id);
19 virtual ~ExternalHostBindings(); 19 virtual ~ExternalHostBindings();
20 20
21 // Invokes the registered onmessage handler. 21 // Invokes the registered onmessage handler.
22 // Returns true on successful invocation. 22 // Returns true on successful invocation.
23 bool ForwardMessageFromExternalHost(const std::string& message, 23 bool ForwardMessageFromExternalHost(const std::string& message,
24 const std::string& origin, 24 const std::string& origin,
25 const std::string& target); 25 const std::string& target);
26 26
27 // Overridden to hold onto a pointer back to the web frame. 27 // Overridden to hold onto a pointer back to the web frame.
28 void BindToJavascript(WebKit::WebFrame* frame, const std::string& classname); 28 void BindToJavascript(blink::WebFrame* frame, const std::string& classname);
29 29
30 private: 30 private:
31 // Creates an uninitialized instance of a MessageEvent object. 31 // Creates an uninitialized instance of a MessageEvent object.
32 // This is equivalent to calling window.document.createEvent("MessageEvent") 32 // This is equivalent to calling window.document.createEvent("MessageEvent")
33 // in javascript. 33 // in javascript.
34 bool CreateMessageEvent(NPObject** message_event); 34 bool CreateMessageEvent(NPObject** message_event);
35 35
36 // The postMessage() function provided to Javascript. 36 // The postMessage() function provided to Javascript.
37 void PostMessage(const webkit_glue::CppArgumentList& args, 37 void PostMessage(const webkit_glue::CppArgumentList& args,
38 webkit_glue::CppVariant* result); 38 webkit_glue::CppVariant* result);
39 39
40 webkit_glue::CppVariant on_message_handler_; 40 webkit_glue::CppVariant on_message_handler_;
41 WebKit::WebFrame* frame_; 41 blink::WebFrame* frame_;
42 IPC::Sender* sender_; 42 IPC::Sender* sender_;
43 int routing_id_; 43 int routing_id_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(ExternalHostBindings); 45 DISALLOW_COPY_AND_ASSIGN(ExternalHostBindings);
46 }; 46 };
47 47
48 #endif // CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_ 48 #endif // CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_
OLDNEW
« no previous file with comments | « chrome/renderer/external_extension.cc ('k') | chrome/renderer/external_host_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698