OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome_frame/urlmon_url_request.h" | 5 #include "chrome_frame/urlmon_url_request.h" |
6 | 6 |
7 #include <wininet.h> | 7 #include <wininet.h> |
8 #include <urlmon.h> | 8 #include <urlmon.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 } else { | 1052 } else { |
1053 NOTREACHED() << "Cannot handle download if we don't have anyone to hand it " | 1053 NOTREACHED() << "Cannot handle download if we don't have anyone to hand it " |
1054 "to."; | 1054 "to."; |
1055 } | 1055 } |
1056 } | 1056 } |
1057 | 1057 |
1058 void UrlmonUrlRequestManager::BindTerminated(IMoniker* moniker, | 1058 void UrlmonUrlRequestManager::BindTerminated(IMoniker* moniker, |
1059 IBindCtx* bind_ctx, | 1059 IBindCtx* bind_ctx, |
1060 IStream* post_data, | 1060 IStream* post_data, |
1061 const char* request_headers) { | 1061 const char* request_headers) { |
1062 DownloadInHostParams download_params; | 1062 DownloadInHostParams* download_params = new DownloadInHostParams; |
1063 download_params.bind_ctx = bind_ctx; | 1063 download_params->bind_ctx = bind_ctx; |
1064 download_params.moniker = moniker; | 1064 download_params->moniker = moniker; |
1065 download_params.post_data = post_data; | 1065 download_params->post_data = post_data; |
1066 if (request_headers) { | 1066 if (request_headers) { |
1067 download_params.request_headers = request_headers; | 1067 download_params->request_headers = request_headers; |
1068 } | 1068 } |
1069 // We use SendMessage and not PostMessage to make sure that if the | 1069 ::PostMessage(notification_window_, WM_DOWNLOAD_IN_HOST, |
1070 // notification window does not handle the message we won't leak | 1070 reinterpret_cast<WPARAM>(download_params), 0); |
1071 // the moniker. | |
1072 ::SendMessage(notification_window_, WM_DOWNLOAD_IN_HOST, | |
1073 reinterpret_cast<WPARAM>(&download_params), 0); | |
1074 } | 1071 } |
1075 | 1072 |
1076 void UrlmonUrlRequestManager::GetCookiesForUrl(const GURL& url, int cookie_id) { | 1073 void UrlmonUrlRequestManager::GetCookiesForUrl(const GURL& url, int cookie_id) { |
1077 DWORD cookie_size = 0; | 1074 DWORD cookie_size = 0; |
1078 bool success = true; | 1075 bool success = true; |
1079 std::string cookie_string; | 1076 std::string cookie_string; |
1080 | 1077 |
1081 int32 cookie_action = COOKIEACTION_READ; | 1078 int32 cookie_action = COOKIEACTION_READ; |
1082 BOOL result = InternetGetCookieA(url.spec().c_str(), NULL, NULL, | 1079 BOOL result = InternetGetCookieA(url.spec().c_str(), NULL, NULL, |
1083 &cookie_size); | 1080 &cookie_size); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 privacy_info_.privacy_records[UTF8ToWide(url)]; | 1243 privacy_info_.privacy_records[UTF8ToWide(url)]; |
1247 | 1244 |
1248 privacy_entry.flags |= flags; | 1245 privacy_entry.flags |= flags; |
1249 privacy_entry.policy_ref = UTF8ToWide(policy_ref); | 1246 privacy_entry.policy_ref = UTF8ToWide(policy_ref); |
1250 | 1247 |
1251 if (fire_privacy_event && IsWindow(notification_window_)) { | 1248 if (fire_privacy_event && IsWindow(notification_window_)) { |
1252 PostMessage(notification_window_, WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, 1, | 1249 PostMessage(notification_window_, WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, 1, |
1253 0); | 1250 0); |
1254 } | 1251 } |
1255 } | 1252 } |
OLD | NEW |