diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-19 16:50:43 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-19 16:50:43 +0000 |
commit | 80b5a8d9ebf236533f154e87b18c9130835ccf06 (patch) | |
tree | 72db1dce801baa370e4f9536820edd7f8f1048a3 /chrome_frame/urlmon_url_request.h | |
parent | 84e1dff96238dfede15aed36ee2a9bf5a71dd9f9 (diff) | |
download | chromium_src-80b5a8d9ebf236533f154e87b18c9130835ccf06.zip chromium_src-80b5a8d9ebf236533f154e87b18c9130835ccf06.tar.gz chromium_src-80b5a8d9ebf236533f154e87b18c9130835ccf06.tar.bz2 |
Initial support for IE View->Privacy. To support this menu option the active document now implements
the Exec command for the CGID_ShellDocView group and command id 75. We invoke the DoPrivacyDlg function
exported by shdocvw and pass in our implementation of the IEnumPrivacyServices interface.
The actual privacy data is gathered and maintained by the UrlmonUrlRequestManager. If we detect a privacy
violation we notify the shell browser via the ITridentService2::FirePrivacyImpactedStateChange function
which ensures that IE displays the privacy icon.
Thanks to stoyan for his help in getting this done.
I will add tests in a followup CL.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=25479
Bug=25479
Review URL: http://codereview.chromium.org/1127003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.h')
-rw-r--r-- | chrome_frame/urlmon_url_request.h | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/chrome_frame/urlmon_url_request.h b/chrome_frame/urlmon_url_request.h index 5382314..38ba257 100644 --- a/chrome_frame/urlmon_url_request.h +++ b/chrome_frame/urlmon_url_request.h @@ -46,6 +46,23 @@ class UrlmonUrlRequestManager : public PluginUrlRequestManager, public PluginUrlRequestDelegate { public: + // Contains the privacy information for all requests issued by this instance. + struct PrivacyInfo { + public: + struct PrivacyEntry { + PrivacyEntry() : flags(0) {} + std::wstring policy_ref; + int32 flags; + }; + + typedef std::map<std::wstring, PrivacyEntry> PrivacyRecords; + + PrivacyInfo() : privacy_impacted(false) {} + + bool privacy_impacted; + PrivacyRecords privacy_records; + }; + UrlmonUrlRequestManager(); ~UrlmonUrlRequestManager(); @@ -53,7 +70,22 @@ class UrlmonUrlRequestManager // Used from ChromeActiveDocument's implementation of IPersistMoniker::Load(). void UseRequestDataForUrl(RequestData* data, const std::wstring& url); void StealMonikerFromRequest(int request_id, IMoniker** moniker); - void SetErrorDialogsParentWindow(HWND window); + + // Returns a copy of the url privacy information for this instance. + PrivacyInfo privacy_info() { + AutoLock lock(privacy_info_lock_); + return privacy_info_; + } + + virtual void AddPrivacyDataForUrl(const std::string& url, + const std::string& policy_ref, + int32 flags); + + // This function passes the window on which notifications are to be fired. + void put_notification_window(HWND window) { + notification_window_ = window; + } + private: friend class MessageLoop; friend struct RunnableMethodTraits<UrlmonUrlRequestManager>; @@ -98,7 +130,13 @@ class UrlmonUrlRequestManager base::WaitableEvent map_empty_; bool stopping_; Lock worker_thread_access_; - HWND err_dialog_parent_wnd_; + + // This lock is used to synchronize access to the PrivacyInfo data structure + // as it can be accessed from the ui thread and the worker thread. + Lock privacy_info_lock_; + PrivacyInfo privacy_info_; + // The window to be used to fire notifications on. + HWND notification_window_; }; #endif // CHROME_FRAME_URLMON_URL_REQUEST_H_ |