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

Side by Side Diff: chrome_frame/bho.h

Issue 1343004: 3rd try. *sigh*... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/automation/automation_messages_internal.h ('k') | chrome_frame/bho.rgs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_FRAME_BHO_H_ 5 #ifndef CHROME_FRAME_BHO_H_
6 #define CHROME_FRAME_BHO_H_ 6 #define CHROME_FRAME_BHO_H_
7 7
8 #include <atlbase.h> 8 #include <atlbase.h>
9 #include <atlcom.h> 9 #include <atlcom.h>
10 #include <deletebrowsinghistory.h>
10 #include <exdisp.h> 11 #include <exdisp.h>
11 #include <exdispid.h> 12 #include <exdispid.h>
12 #include <mshtml.h> 13 #include <mshtml.h>
13 #include <shdeprecated.h> 14 #include <shdeprecated.h>
14 15
15 #include <string> 16 #include <string>
16 17
17 #include "base/scoped_comptr_win.h" 18 #include "base/scoped_comptr_win.h"
18 #include "chrome_tab.h" // NOLINT 19 #include "chrome_tab.h" // NOLINT
20 #include "chrome_frame/delete_chrome_history.h"
19 #include "chrome_frame/resource.h" 21 #include "chrome_frame/resource.h"
20 #include "chrome_frame/urlmon_moniker.h" 22 #include "chrome_frame/urlmon_moniker.h"
21 #include "chrome_frame/urlmon_url_request.h" 23 #include "chrome_frame/urlmon_url_request.h"
22 #include "grit/chrome_frame_resources.h" 24 #include "grit/chrome_frame_resources.h"
23 25
26 class DeleteChromeHistory;
27
24 class PatchHelper { 28 class PatchHelper {
25 public: 29 public:
26 enum State { UNKNOWN, PATCH_IBROWSER, PATCH_PROTOCOL }; 30 enum State { UNKNOWN, PATCH_IBROWSER, PATCH_PROTOCOL };
27 PatchHelper() : state_(UNKNOWN) { 31 PatchHelper() : state_(UNKNOWN) {
28 } 32 }
29 33
30 State state() const { 34 State state() const {
31 return state_; 35 return state_;
32 } 36 }
33 37
(...skipping 14 matching lines...) Expand all
48 : public CComObjectRootEx<CComSingleThreadModel>, 52 : public CComObjectRootEx<CComSingleThreadModel>,
49 public CComCoClass<Bho, &CLSID_ChromeFrameBHO>, 53 public CComCoClass<Bho, &CLSID_ChromeFrameBHO>,
50 public IObjectWithSiteImpl<Bho>, 54 public IObjectWithSiteImpl<Bho>,
51 public IDispEventSimpleImpl<0, Bho, &DIID_DWebBrowserEvents2>, 55 public IDispEventSimpleImpl<0, Bho, &DIID_DWebBrowserEvents2>,
52 public NavigationManager { 56 public NavigationManager {
53 public: 57 public:
54 typedef HRESULT (STDMETHODCALLTYPE* IBrowserService_OnHttpEquiv_Fn)( 58 typedef HRESULT (STDMETHODCALLTYPE* IBrowserService_OnHttpEquiv_Fn)(
55 IBrowserService* browser, IShellView* shell_view, BOOL done, 59 IBrowserService* browser, IShellView* shell_view, BOOL done,
56 VARIANT* in_arg, VARIANT* out_arg); 60 VARIANT* in_arg, VARIANT* out_arg);
57 61
62 DECLARE_GET_CONTROLLING_UNKNOWN()
58 DECLARE_REGISTRY_RESOURCEID(IDR_BHO) 63 DECLARE_REGISTRY_RESOURCEID(IDR_BHO)
59 DECLARE_NOT_AGGREGATABLE(Bho) 64 DECLARE_NOT_AGGREGATABLE(Bho)
60 DECLARE_PROTECT_FINAL_CONSTRUCT() 65 DECLARE_PROTECT_FINAL_CONSTRUCT()
61 66
62 BEGIN_COM_MAP(Bho) 67 BEGIN_COM_MAP(Bho)
63 COM_INTERFACE_ENTRY(IObjectWithSite) 68 COM_INTERFACE_ENTRY(IObjectWithSite)
69 // When calling DeleteChromeHistory, ensure that only one instance
70 // is created to avoid mulitple message loops.
71 COM_INTERFACE_ENTRY_CACHED_TEAR_OFF(IID_IDeleteBrowsingHistory,
72 DeleteChromeHistory,
73 delete_chrome_history_.p)
64 END_COM_MAP() 74 END_COM_MAP()
65 75
66 BEGIN_SINK_MAP(Bho) 76 BEGIN_SINK_MAP(Bho)
67 SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2, 77 SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2,
68 BeforeNavigate2, &kBeforeNavigate2Info) 78 BeforeNavigate2, &kBeforeNavigate2Info)
69 SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_NAVIGATECOMPLETE2, 79 SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_NAVIGATECOMPLETE2,
70 NavigateComplete2, &kNavigateComplete2Info) 80 NavigateComplete2, &kNavigateComplete2Info)
71 END_SINK_MAP() 81 END_SINK_MAP()
72 82
73 Bho(); 83 Bho();
(...skipping 15 matching lines...) Expand all
89 // us to sniff the META tag by simply patching it. The renderer 99 // us to sniff the META tag by simply patching it. The renderer
90 // switching can be achieved by canceling original navigation 100 // switching can be achieved by canceling original navigation
91 // and issuing a new one using IWebBrowser2->Navigate2. 101 // and issuing a new one using IWebBrowser2->Navigate2.
92 static HRESULT STDMETHODCALLTYPE OnHttpEquiv( 102 static HRESULT STDMETHODCALLTYPE OnHttpEquiv(
93 IBrowserService_OnHttpEquiv_Fn original_httpequiv, 103 IBrowserService_OnHttpEquiv_Fn original_httpequiv,
94 IBrowserService* browser, IShellView* shell_view, BOOL done, 104 IBrowserService* browser, IShellView* shell_view, BOOL done,
95 VARIANT* in_arg, VARIANT* out_arg); 105 VARIANT* in_arg, VARIANT* out_arg);
96 106
97 static void ProcessOptInUrls(IWebBrowser2* browser, BSTR url); 107 static void ProcessOptInUrls(IWebBrowser2* browser, BSTR url);
98 108
109 // COM_INTERFACE_ENTRY_CACHED_TEAR_OFF manages the raw pointer from CComPtr
110 // which ScopedComPtr doesn't expose.
111 CComPtr<IUnknown> delete_chrome_history_;
112
99 protected: 113 protected:
100 bool PatchProtocolHandler(const CLSID& handler_clsid); 114 bool PatchProtocolHandler(const CLSID& handler_clsid);
101 115
102 static _ATL_FUNC_INFO kBeforeNavigate2Info; 116 static _ATL_FUNC_INFO kBeforeNavigate2Info;
103 static _ATL_FUNC_INFO kNavigateComplete2Info; 117 static _ATL_FUNC_INFO kNavigateComplete2Info;
104 }; 118 };
105 119
106 #endif // CHROME_FRAME_BHO_H_ 120 #endif // CHROME_FRAME_BHO_H_
107 121
OLDNEW
« no previous file with comments | « chrome/test/automation/automation_messages_internal.h ('k') | chrome_frame/bho.rgs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698