summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_protocol.cc
diff options
context:
space:
mode:
authorslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-24 05:11:58 +0000
committerslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-24 05:11:58 +0000
commitf781782dd67077478e117c61dca4ea5eefce3544 (patch)
tree4801f724123cfdcbb69c4e7fe40a565b331723ae /chrome_frame/chrome_protocol.cc
parent63cf4759efa2373e33436fb5df6849f930081226 (diff)
downloadchromium_src-f781782dd67077478e117c61dca4ea5eefce3544.zip
chromium_src-f781782dd67077478e117c61dca4ea5eefce3544.tar.gz
chromium_src-f781782dd67077478e117c61dca4ea5eefce3544.tar.bz2
Initial import of the Chrome Frame codebase. Integration in chrome.gyp coming in a separate CL.
BUG=None TEST=None Review URL: http://codereview.chromium.org/218019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_protocol.cc')
-rw-r--r--chrome_frame/chrome_protocol.cc85
1 files changed, 85 insertions, 0 deletions
diff --git a/chrome_frame/chrome_protocol.cc b/chrome_frame/chrome_protocol.cc
new file mode 100644
index 0000000..87ca34e
--- /dev/null
+++ b/chrome_frame/chrome_protocol.cc
@@ -0,0 +1,85 @@
+// Copyright (c) 2009 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.
+
+// Implementation of ChromeProtocol
+#include "chrome_frame/chrome_protocol.h"
+
+#include "base/logging.h"
+
+static const wchar_t* kChromeMimeType = L"application/chromepage";
+
+// ChromeProtocol
+
+// Starts the class associated with the asynchronous pluggable protocol.
+STDMETHODIMP ChromeProtocol::Start(LPCWSTR url,
+ IInternetProtocolSink* prot_sink,
+ IInternetBindInfo* bind_info,
+ DWORD flags,
+ DWORD reserved) {
+ DLOG(INFO) << __FUNCTION__ << ": URL = " << url;
+ prot_sink->ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
+ kChromeMimeType);
+ prot_sink->ReportData(
+ BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION |
+ BSCF_DATAFULLYAVAILABLE,
+ 0,
+ 0);
+ return S_OK;
+}
+
+// Allows the pluggable protocol handler to continue processing data on the
+// apartment (or user interface) thread. This method is called in response
+// to a call to IInternetProtocolSink::Switch.
+STDMETHODIMP ChromeProtocol::Continue(PROTOCOLDATA* protocol_data) {
+ DLOG(INFO) << __FUNCTION__;
+ return S_OK;
+}
+
+// Aborts an operation in progress.
+STDMETHODIMP ChromeProtocol::Abort(HRESULT reason, DWORD options) {
+ DLOG(INFO) << __FUNCTION__;
+ return S_OK;
+}
+
+STDMETHODIMP ChromeProtocol::Terminate(DWORD options) {
+ DLOG(INFO) << __FUNCTION__;
+ return S_OK;
+}
+
+STDMETHODIMP ChromeProtocol::Suspend() {
+ return E_NOTIMPL;
+}
+STDMETHODIMP ChromeProtocol::Resume() {
+ return E_NOTIMPL;
+}
+
+// Reads data retrieved by the pluggable protocol handler.
+STDMETHODIMP ChromeProtocol::Read(void* buffer,
+ ULONG buffer_size_in_bytes,
+ ULONG* bytes_read) {
+ DLOG(INFO) << __FUNCTION__;
+ return S_FALSE;
+}
+
+// Moves the current seek offset.
+STDMETHODIMP ChromeProtocol::Seek(LARGE_INTEGER move_by,
+ DWORD origin,
+ ULARGE_INTEGER* new_position) {
+ DLOG(INFO) << __FUNCTION__;
+ return E_NOTIMPL;
+}
+
+// Locks the request so that IInternetProtocolRoot::Terminate ()
+// can be called and the remaining data can be read.
+STDMETHODIMP ChromeProtocol::LockRequest(DWORD options) {
+ DLOG(INFO) << __FUNCTION__;
+ return S_OK;
+}
+
+// Frees any resources associated with a lock. Called only if
+// IInternetProtocol::LockRequest () was called.
+STDMETHODIMP ChromeProtocol::UnlockRequest() {
+ DLOG(INFO) << __FUNCTION__;
+ return S_OK;
+}