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