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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 10941042: Browser plugin: Implement loadStart and loadAbort events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed creis@'s comments Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 8337c0a1183384c012b1f5c1d51972ced302a20a..9dc3c5c2bf85687ae88e3f90ff238eafa55cf258 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -74,6 +74,13 @@ void BrowserPluginGuest::Go(int relative_index) {
web_contents()->GetController().GoToOffset(relative_index);
}
+bool BrowserPluginGuest::CanDownload(RenderViewHost* render_view_host,
+ int request_id,
+ const std::string& request_method) {
+ // TODO(fsamuel): content_shell seems to ignore this.
Charlie Reis 2012/10/04 02:57:48 nit: Also have a comment saying why we return fals
Fady Samuel 2012/10/04 15:04:51 Done.
+ return false;
+}
+
void BrowserPluginGuest::RendererUnresponsive(WebContents* source) {
base::ProcessHandle process_handle =
web_contents()->GetRenderProcessHost()->GetHandle();
@@ -271,6 +278,34 @@ void BrowserPluginGuest::SetCursor(const WebCursor& cursor) {
cursor_ = cursor;
}
+void BrowserPluginGuest::DidStartProvisionalLoadForFrame(
+ int64 frame_id,
+ bool is_main_frame,
+ const GURL& validated_url,
+ bool is_error_page,
+ RenderViewHost* render_view_host) {
+ // Inform the embedder of the loadStart.
+ SendMessageToEmbedder(
+ new BrowserPluginMsg_LoadStart(instance_id(),
+ validated_url,
+ is_main_frame));
+}
+
+void BrowserPluginGuest::DidFailProvisionalLoad(
+ int64 frame_id,
+ bool is_main_frame,
+ const GURL& validated_url,
+ int error_code,
+ const string16& error_description,
+ RenderViewHost* render_view_host) {
+ // Inform the embedder of the loadAbort.
+ SendMessageToEmbedder(
+ new BrowserPluginMsg_LoadAbort(instance_id(),
+ validated_url,
+ is_main_frame,
+ UTF16ToASCII(error_description)));
Charlie Reis 2012/10/04 02:57:48 I was expecting us to return one of "networkError,
Fady Samuel 2012/10/04 15:04:51 Done. Using net::ErrorToString. The list of errors
Charlie Reis 2012/10/04 17:06:55 Interesting... I wonder if this is an appropriate
+}
+
void BrowserPluginGuest::DidCommitProvisionalLoadForFrame(
int64 frame_id,
bool is_main_frame,

Powered by Google App Engine
This is Rietveld 408576698