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

Side by Side Diff: webkit/glue/plugins/pepper_webplugin_impl.cc

Issue 2842036: Add support for HandleDocumentLoad. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months 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 | « webkit/glue/plugins/pepper_webplugin_impl.h ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_webplugin_impl.h" 5 #include "webkit/glue/plugins/pepper_webplugin_impl.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "third_party/ppapi/c/pp_var.h" 9 #include "third_party/ppapi/c/pp_var.h"
10 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" 10 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h"
11 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" 11 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
12 #include "webkit/glue/plugins/pepper_plugin_instance.h" 12 #include "webkit/glue/plugins/pepper_plugin_instance.h"
13 #include "webkit/glue/plugins/pepper_plugin_module.h" 13 #include "webkit/glue/plugins/pepper_plugin_module.h"
14 #include "webkit/glue/plugins/pepper_url_loader.h"
14 #include "webkit/glue/plugins/pepper_var.h" 15 #include "webkit/glue/plugins/pepper_var.h"
15 16
16 using WebKit::WebCanvas; 17 using WebKit::WebCanvas;
17 using WebKit::WebPluginContainer; 18 using WebKit::WebPluginContainer;
18 using WebKit::WebPluginParams; 19 using WebKit::WebPluginParams;
19 using WebKit::WebRect; 20 using WebKit::WebRect;
20 using WebKit::WebVector; 21 using WebKit::WebVector;
21 22
22 namespace pepper { 23 namespace pepper {
23 24
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return true; 97 return true;
97 } 98 }
98 99
99 bool WebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event, 100 bool WebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event,
100 WebKit::WebCursorInfo& cursor_info) { 101 WebKit::WebCursorInfo& cursor_info) {
101 return instance_->HandleInputEvent(event, &cursor_info); 102 return instance_->HandleInputEvent(event, &cursor_info);
102 } 103 }
103 104
104 void WebPluginImpl::didReceiveResponse( 105 void WebPluginImpl::didReceiveResponse(
105 const WebKit::WebURLResponse& response) { 106 const WebKit::WebURLResponse& response) {
107 DCHECK(!document_loader_);
108
109 document_loader_ = new URLLoader(instance_);
110 document_loader_->didReceiveResponse(NULL, response);
111
112 if (!instance_->HandleDocumentLoad(document_loader_))
113 document_loader_ = NULL;
106 } 114 }
107 115
108 void WebPluginImpl::didReceiveData(const char* data, int data_length) { 116 void WebPluginImpl::didReceiveData(const char* data, int data_length) {
117 if (document_loader_)
118 document_loader_->didReceiveData(NULL, data, data_length);
109 } 119 }
110 120
111 void WebPluginImpl::didFinishLoading() { 121 void WebPluginImpl::didFinishLoading() {
122 if (document_loader_) {
123 document_loader_->didFinishLoading(NULL);
124 document_loader_ = NULL;
125 }
112 } 126 }
113 127
114 void WebPluginImpl::didFailLoading(const WebKit::WebURLError&) { 128 void WebPluginImpl::didFailLoading(const WebKit::WebURLError& error) {
129 if (document_loader_) {
130 document_loader_->didFail(NULL, error);
131 document_loader_ = NULL;
132 }
115 } 133 }
116 134
117 void WebPluginImpl::didFinishLoadingFrameRequest(const WebKit::WebURL& url, 135 void WebPluginImpl::didFinishLoadingFrameRequest(const WebKit::WebURL& url,
118 void* notify_data) { 136 void* notify_data) {
119 } 137 }
120 138
121 void WebPluginImpl::didFailLoadingFrameRequest( 139 void WebPluginImpl::didFailLoadingFrameRequest(
122 const WebKit::WebURL& url, 140 const WebKit::WebURL& url,
123 void* notify_data, 141 void* notify_data,
124 const WebKit::WebURLError& error) { 142 const WebKit::WebURLError& error) {
125 } 143 }
126 144
127 } // namespace pepper 145 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_webplugin_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698