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. 4 5 #ifndef CHROME_FRAME_DELETE_CHROME_HISTORY_H_ 6 #define CHROME_FRAME_DELETE_CHROME_HISTORY_H_ 7 8 #include <atlbase.h> 9 #include <atlwin.h> 10 #include <atlcom.h> 11 12 #include <deletebrowsinghistory.h> 13 14 #include "base/message_loop/message_loop.h" 15 #include "chrome_frame/bho.h" 16 #include "chrome_frame/chrome_frame_plugin.h" 17 #include "chrome_frame/chrome_tab.h" 18 #include "grit/chrome_frame_resources.h" 19 20 class Bho; 21 22 // DeleteChromeHistory: Implements IDeleteBrowsingHistory and 23 // pumps cache clearing operations over automation. Blocks the UI 24 // thread while operating. You have been warned. 25 class ATL_NO_VTABLE DeleteChromeHistory 26 : public CComTearOffObjectBase<Bho, CComSingleThreadModel>, 27 public CWindowImpl<DeleteChromeHistory>, 28 public ChromeFramePlugin<DeleteChromeHistory>, 29 public IDeleteBrowsingHistory { 30 public: 31 DeleteChromeHistory(); 32 ~DeleteChromeHistory(); 33 34 HRESULT FinalConstruct(); 35 36 DECLARE_CLASSFACTORY_SINGLETON(DeleteChromeHistory) 37 38 BEGIN_COM_MAP(DeleteChromeHistory) 39 COM_INTERFACE_ENTRY(IDeleteBrowsingHistory) 40 END_COM_MAP() 41 42 BEGIN_MSG_MAP(DeleteChromeHistory) 43 CHAIN_MSG_MAP(ChromeFramePlugin<DeleteChromeHistory>) 44 END_MSG_MAP() 45 46 // IDeleteBrowsingHistory methods 47 STDMETHOD(DeleteBrowsingHistory)(DWORD flags); 48 49 protected: 50 // ChromeFrameDelegate overrides 51 virtual void OnAutomationServerReady(); 52 virtual void OnAutomationServerLaunchFailed( 53 AutomationLaunchResult reason, const std::string& server_version); 54 55 virtual void GetProfilePath(const std::wstring& profile_name, 56 base::FilePath* profile_path); 57 58 private: 59 unsigned long remove_mask_; 60 base::MessageLoopForUI loop_; 61 }; 62 63 #endif // CHROME_FRAME_DELETE_CHROME_HISTORY_H_ 64