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

Side by Side Diff: components/plugins/renderer/webview_plugin.h

Issue 116163008: Move the plugin placeholder from CppBoundClass to gin::Wrappable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ 5 #ifndef COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_
6 #define COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ 6 #define COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 22 matching lines...) Expand all
33 public blink::WebViewClient, 33 public blink::WebViewClient,
34 public blink::WebFrameClient { 34 public blink::WebFrameClient {
35 public: 35 public:
36 class Delegate { 36 class Delegate {
37 public: 37 public:
38 // Bind |frame| to a Javascript object, enabling the delegate to receive 38 // Bind |frame| to a Javascript object, enabling the delegate to receive
39 // callback methods from Javascript inside the WebFrame. 39 // callback methods from Javascript inside the WebFrame.
40 // This method is called from WebFrameClient::didClearWindowObject. 40 // This method is called from WebFrameClient::didClearWindowObject.
41 virtual void BindWebFrame(blink::WebFrame* frame) = 0; 41 virtual void BindWebFrame(blink::WebFrame* frame) = 0;
42 42
43 // Called before the WebViewPlugin is destroyed. The delegate should delete
44 // itself here.
45 virtual void WillDestroyPlugin() = 0;
46
47 // Called upon a context menu event. 43 // Called upon a context menu event.
48 virtual void ShowContextMenu(const blink::WebMouseEvent&) = 0; 44 virtual void ShowContextMenu(const blink::WebMouseEvent&) = 0;
49 }; 45 };
50 46
51 explicit WebViewPlugin(Delegate* delegate); 47 explicit WebViewPlugin(Delegate* delegate);
52 48
53 // Convenience method to set up a new WebViewPlugin using |preferences| 49 // Convenience method to set up a new WebViewPlugin using |preferences|
54 // and displaying |html_data|. |url| should be a (fake) chrome:// URL; it is 50 // and displaying |html_data|. |url| should be a (fake) chrome:// URL; it is
55 // only used for navigation and never actually resolved. 51 // only used for navigation and never actually resolved.
56 static WebViewPlugin* Create(Delegate* delegate, 52 static WebViewPlugin* Create(Delegate* delegate,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // (which does nothing) to correctly overload it. 126 // (which does nothing) to correctly overload it.
131 virtual void didReceiveResponse(blink::WebFrame* frame, 127 virtual void didReceiveResponse(blink::WebFrame* frame,
132 unsigned identifier, 128 unsigned identifier,
133 const blink::WebURLResponse& response); 129 const blink::WebURLResponse& response);
134 130
135 private: 131 private:
136 friend class base::DeleteHelper<WebViewPlugin>; 132 friend class base::DeleteHelper<WebViewPlugin>;
137 virtual ~WebViewPlugin(); 133 virtual ~WebViewPlugin();
138 134
139 Delegate* delegate_; 135 Delegate* delegate_;
140 // Destroys itself. 136 // Destroys itself.
Bernhard Bauer 2014/01/07 09:35:42 I think this comment refers to |delegate_| and som
jochen (gone - plz use gerrit) 2014/01/08 19:18:23 Done.
141 blink::WebCursorInfo current_cursor_; 137 blink::WebCursorInfo current_cursor_;
142 // Owns us. 138 // Owns us.
143 blink::WebPluginContainer* container_; 139 blink::WebPluginContainer* container_;
144 // Owned by us, deleted via |close()|. 140 // Owned by us, deleted via |close()|.
145 blink::WebView* web_view_; 141 blink::WebView* web_view_;
146 gfx::Rect rect_; 142 gfx::Rect rect_;
147 143
148 blink::WebURLResponse response_; 144 blink::WebURLResponse response_;
149 std::list<std::string> data_; 145 std::list<std::string> data_;
150 bool finished_loading_; 146 bool finished_loading_;
151 scoped_ptr<blink::WebURLError> error_; 147 scoped_ptr<blink::WebURLError> error_;
152 blink::WebString old_title_; 148 blink::WebString old_title_;
153 }; 149 };
154 150
155 #endif // COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ 151 #endif // COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698