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

Unified Diff: chrome/renderer/frame_sniffer.cc

Issue 7779010: Implements frame sniffer to watch iframe loading state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 9 years, 3 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
« no previous file with comments | « chrome/renderer/frame_sniffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/frame_sniffer.cc
diff --git a/chrome/renderer/frame_sniffer.cc b/chrome/renderer/frame_sniffer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e026b3981385ca3cb9a3b551b96e23b094a3b420
--- /dev/null
+++ b/chrome/renderer/frame_sniffer.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/renderer/frame_sniffer.h"
+
+#include "base/logging.h"
+#include "chrome/common/render_messages.h"
+#include "content/common/view_messages.h"
+#include "content/renderer/navigation_state.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
+
+FrameSniffer::FrameSniffer(RenderView* render_view, const string16 &frame_name)
+ : RenderViewObserver(render_view), frame_name_(frame_name) {
+}
+
+FrameSniffer::~FrameSniffer() {
+}
+
+void FrameSniffer::DidFailProvisionalLoad(WebKit::WebFrame* frame,
+ const WebKit::WebURLError& error) {
+ if (!ShouldSniffFrame(frame))
+ return;
+ Send(new ChromeViewHostMsg_FrameLoadingError(routing_id(), -error.reason));
+}
+
+bool FrameSniffer::ShouldSniffFrame(WebKit::WebFrame* frame) {
+ return frame->name() == frame_name_;
+}
« no previous file with comments | « chrome/renderer/frame_sniffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698