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/chrome_frame_activex_base.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/chrome_frame_activex_base.h')
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index c585766..a8191a9 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -428,9 +428,14 @@ END_MSG_MAP() data = cookie; } - BOOL ret = InternetSetCookieA(url.spec().c_str(), name.c_str(), - data.c_str()); - DCHECK(ret) << "InternetSetcookie failed. Error: " << GetLastError(); + int32 flags = INTERNET_COOKIE_EVALUATE_P3P; + + InternetCookieState cookie_state = static_cast<InternetCookieState>( + InternetSetCookieExA(url.spec().c_str(), name.c_str(), data.c_str(), + flags, NULL)); + + int32 cookie_action = MapCookieStateToCookieAction(cookie_state); + url_fetcher_.AddPrivacyDataForUrl(url.spec(), "", cookie_action); } virtual void OnGetCookiesFromHost(int tab_handle, const GURL& url, @@ -438,19 +443,25 @@ END_MSG_MAP() DWORD cookie_size = 0; bool success = true; std::string cookie_string; - InternetGetCookieA(url.spec().c_str(), NULL, NULL, &cookie_size); + + int32 cookie_action = COOKIEACTION_READ; + BOOL result = InternetGetCookieA(url.spec().c_str(), NULL, NULL, + &cookie_size); + DWORD error = 0; if (cookie_size) { scoped_array<char> cookies(new char[cookie_size + 1]); if (!InternetGetCookieA(url.spec().c_str(), NULL, cookies.get(), &cookie_size)) { success = false; - NOTREACHED() << "InternetGetCookie failed. Error: " << GetLastError(); + error = GetLastError(); + NOTREACHED() << "InternetGetCookie failed. Error: " << error; } else { cookie_string = cookies.get(); } } else { success = false; - DLOG(INFO) << "InternetGetCookie failed. Error: " << GetLastError(); + error = GetLastError(); + DLOG(INFO) << "InternetGetCookie failed. Error: " << error; } if (automation_client_->automation_server()) { @@ -459,6 +470,11 @@ END_MSG_MAP() url, cookie_string, cookie_id)); } + + if (!success && !error) + cookie_action = COOKIEACTION_SUPPRESS; + + url_fetcher_.AddPrivacyDataForUrl(url.spec(), "", cookie_action); } virtual void OnAttachExternalTab(int tab_handle, @@ -480,7 +496,7 @@ END_MSG_MAP() LRESULT OnCreate(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { // NO_LINT ModifyStyle(0, WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0); - url_fetcher_.SetErrorDialogsParentWindow(m_hWnd); + url_fetcher_.put_notification_window(m_hWnd); automation_client_->SetParentWindow(m_hWnd); // Only fire the 'interactive' ready state if we aren't there already. if (ready_state_ < READYSTATE_INTERACTIVE) { |