1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_FRAME_CHROME_PROTOCOL_H_
6 #define CHROME_FRAME_CHROME_PROTOCOL_H_
11 #include "chrome_frame/chrome_tab.h"
12 #include "chrome_frame/resource.h"
13 #include "grit/chrome_frame_resources.h"
16 class ATL_NO_VTABLE ChromeProtocol
17 : public CComObjectRootEx
<CComSingleThreadModel
>,
18 public CComCoClass
<ChromeProtocol
, &CLSID_ChromeProtocol
>,
19 public IInternetProtocol
{
23 DECLARE_REGISTRY_RESOURCEID(IDR_CHROMEPROTOCOL
)
25 BEGIN_COM_MAP(ChromeProtocol
)
26 COM_INTERFACE_ENTRY(IInternetProtocol
)
27 COM_INTERFACE_ENTRY(IInternetProtocolRoot
)
30 DECLARE_PROTECT_FINAL_CONSTRUCT()
32 HRESULT
FinalConstruct() {
39 // IInternetProtocolRoot
40 STDMETHOD(Start
)(LPCWSTR url
,
41 IInternetProtocolSink
* prot_sink
,
42 IInternetBindInfo
* bind_info
,
45 STDMETHOD(Continue
)(PROTOCOLDATA
* protocol_data
);
46 STDMETHOD(Abort
)(HRESULT reason
, DWORD options
);
47 STDMETHOD(Terminate
)(DWORD options
);
51 // IInternetProtocol based on IInternetProtocolRoot
52 STDMETHOD(Read
)(void* buffer
,
53 ULONG buffer_size_in_bytes
,
55 STDMETHOD(Seek
)(LARGE_INTEGER move_by
,
57 ULARGE_INTEGER
* new_position
);
58 STDMETHOD(LockRequest
)(DWORD options
);
59 STDMETHOD(UnlockRequest
)(void);
62 #endif // CHROME_FRAME_CHROME_PROTOCOL_H_