summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/ie_event_sink.h
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 14:09:37 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 14:09:37 +0000
commitbbfa9a15797ba107dcae0f7fff85a7f12ffd26b9 (patch)
treeee15898939e4989b96c6419217696f63d7a5585b /chrome_frame/test/ie_event_sink.h
parente721ebe885b159f9b18047392be9a0f5834998fb (diff)
downloadchromium_src-bbfa9a15797ba107dcae0f7fff85a7f12ffd26b9.zip
chromium_src-bbfa9a15797ba107dcae0f7fff85a7f12ffd26b9.tar.gz
chromium_src-bbfa9a15797ba107dcae0f7fff85a7f12ffd26b9.tar.bz2
Handle automation server crashes. When Chrome crashes, we now handle the case and support document refresh or reload.
When chrome crashes, we draw a poor man's sad tab (":-("), so that can clearly be improved. Another thing is that if the chrome instance that crashed held several navigational entries, then that history is lost. TEST=There are a couple of tests included, so run those (*TabCrash*) and also verify that when the chrome automation server is killed that we do the right thing. Also check info in bug report. BUG=25839 Review URL: http://codereview.chromium.org/3061036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/ie_event_sink.h')
-rw-r--r--chrome_frame/test/ie_event_sink.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/chrome_frame/test/ie_event_sink.h b/chrome_frame/test/ie_event_sink.h
index 48b5d30..ac1bf93 100644
--- a/chrome_frame/test/ie_event_sink.h
+++ b/chrome_frame/test/ie_event_sink.h
@@ -57,6 +57,14 @@ class IEEventListener {
virtual void OnNewBrowserWindow(IDispatch* new_window, const wchar_t* url) {}
};
+// Listener for IPropertyNotifySink.
+class PropertyNotifySinkListener {
+ public:
+ virtual ~PropertyNotifySinkListener() {}
+ virtual void OnChanged(DISPID dispid) {}
+ virtual void OnRequestEdit(DISPID dispid) {}
+};
+
// This class sets up event sinks to the IWebBrowser interface. It forwards
// all events to its listener.
// TODO(kkania): Delete WebBrowserEventSink and use this class instead for
@@ -229,6 +237,38 @@ END_SINK_MAP()
static _ATL_FUNC_INFO kFileDownloadInfo;
};
+class PropertyNotifySinkImpl
+ : public CComObjectRootEx<CComSingleThreadModel>,
+ public IPropertyNotifySink {
+ public:
+ PropertyNotifySinkImpl() : listener_(NULL) {
+ }
+
+BEGIN_COM_MAP(PropertyNotifySinkImpl)
+ COM_INTERFACE_ENTRY(IPropertyNotifySink)
+END_COM_MAP()
+
+ STDMETHOD(OnChanged)(DISPID dispid) {
+ if (listener_)
+ listener_->OnChanged(dispid);
+ return S_OK;
+ }
+
+ STDMETHOD(OnRequestEdit)(DISPID dispid) {
+ if (listener_)
+ listener_->OnRequestEdit(dispid);
+ return S_OK;
+ }
+
+ void set_listener(PropertyNotifySinkListener* listener) {
+ DCHECK(listener_ == NULL || listener == NULL);
+ listener_ = listener;
+ }
+
+ protected:
+ PropertyNotifySinkListener* listener_;
+};
+
} // namespace chrome_frame_test
#endif // CHROME_FRAME_TEST_IE_EVENT_SINK_H_