| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ | 5 #ifndef CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ |
| 6 #define CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ | 6 #define CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlcom.h> | 9 #include <atlcom.h> |
| 10 #include <atlctl.h> | 10 #include <atlctl.h> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "base/scoped_comptr_win.h" | 35 #include "base/scoped_comptr_win.h" |
| 36 #include "base/scoped_variant_win.h" | 36 #include "base/scoped_variant_win.h" |
| 37 #include "base/string_util.h" | 37 #include "base/string_util.h" |
| 38 #include "grit/chrome_frame_resources.h" | 38 #include "grit/chrome_frame_resources.h" |
| 39 #include "grit/chrome_frame_strings.h" | 39 #include "grit/chrome_frame_strings.h" |
| 40 #include "chrome_frame/chrome_frame_plugin.h" | 40 #include "chrome_frame/chrome_frame_plugin.h" |
| 41 #include "chrome_frame/com_message_event.h" | 41 #include "chrome_frame/com_message_event.h" |
| 42 #include "chrome_frame/com_type_info_holder.h" | 42 #include "chrome_frame/com_type_info_holder.h" |
| 43 #include "chrome_frame/urlmon_url_request.h" | 43 #include "chrome_frame/urlmon_url_request.h" |
| 44 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
| 45 #include "net/base/cookie_monster.h" | |
| 46 | 45 |
| 47 // Include without path to make GYP build see it. | 46 // Include without path to make GYP build see it. |
| 48 #include "chrome_tab.h" // NOLINT | 47 #include "chrome_tab.h" // NOLINT |
| 49 | 48 |
| 50 // Connection point class to support firing IChromeFrameEvents (dispinterface). | 49 // Connection point class to support firing IChromeFrameEvents (dispinterface). |
| 51 template<class T> | 50 template<class T> |
| 52 class ATL_NO_VTABLE ProxyDIChromeFrameEvents | 51 class ATL_NO_VTABLE ProxyDIChromeFrameEvents |
| 53 : public IConnectionPointImpl<T, &DIID_DIChromeFrameEvents> { | 52 : public IConnectionPointImpl<T, &DIID_DIChromeFrameEvents> { |
| 54 public: | 53 public: |
| 55 void FireMethodWithParams(ChromeFrameEventDispId dispid, | 54 void FireMethodWithParams(ChromeFrameEventDispId dispid, |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 if (request) { | 516 if (request) { |
| 518 static_cast<UrlmonUrlRequest*>(request)->TransferToHost(doc_site_); | 517 static_cast<UrlmonUrlRequest*>(request)->TransferToHost(doc_site_); |
| 519 } | 518 } |
| 520 automation_client_->RemoveRequest(request_id, false); | 519 automation_client_->RemoveRequest(request_id, false); |
| 521 } | 520 } |
| 522 | 521 |
| 523 virtual void OnSetCookieAsync(int tab_handle, const GURL& url, | 522 virtual void OnSetCookieAsync(int tab_handle, const GURL& url, |
| 524 const std::string& cookie) { | 523 const std::string& cookie) { |
| 525 std::string name; | 524 std::string name; |
| 526 std::string data; | 525 std::string data; |
| 527 | |
| 528 size_t name_end = cookie.find('='); | 526 size_t name_end = cookie.find('='); |
| 529 if (std::string::npos != name_end) { | 527 if (std::string::npos != name_end) { |
| 530 net::CookieMonster::ParsedCookie parsed_cookie = cookie; | 528 name = cookie.substr(0, name_end); |
| 531 name = parsed_cookie.Name(); | 529 data = cookie.substr(name_end + 1); |
| 532 // Verify if the cookie is being deleted. The cookie format is as below | |
| 533 // value[; expires=date][; domain=domain][; path=path][; secure] | |
| 534 // If the first semicolon appears immediately after the name= string, | |
| 535 // it means that the cookie is being deleted. | |
| 536 if (!parsed_cookie.Value().empty()) | |
| 537 data = cookie.substr(name_end + 1); | |
| 538 } else { | 530 } else { |
| 539 data = cookie; | 531 data = cookie; |
| 540 } | 532 } |
| 541 | 533 |
| 542 BOOL ret = InternetSetCookieA(url.spec().c_str(), name.c_str(), | 534 BOOL ret = InternetSetCookieA(url.spec().c_str(), name.c_str(), |
| 543 data.c_str()); | 535 data.c_str()); |
| 544 DCHECK(ret) << "InternetSetcookie failed. Error: " << GetLastError(); | 536 DCHECK(ret) << "InternetSetcookie failed. Error: " << GetLastError(); |
| 545 } | 537 } |
| 546 | 538 |
| 547 virtual void OnAttachExternalTab(int tab_handle, | 539 virtual void OnAttachExternalTab(int tab_handle, |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 EventHandlers onprivatemessage_; | 1132 EventHandlers onprivatemessage_; |
| 1141 EventHandlers onextensionready_; | 1133 EventHandlers onextensionready_; |
| 1142 | 1134 |
| 1143 // The UrlmonUrlRequest instance instantiated for downloading the base URL. | 1135 // The UrlmonUrlRequest instance instantiated for downloading the base URL. |
| 1144 scoped_refptr<CComObject<UrlmonUrlRequest> > base_url_request_; | 1136 scoped_refptr<CComObject<UrlmonUrlRequest> > base_url_request_; |
| 1145 | 1137 |
| 1146 base::Thread worker_thread_; | 1138 base::Thread worker_thread_; |
| 1147 }; | 1139 }; |
| 1148 | 1140 |
| 1149 #endif // CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ | 1141 #endif // CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ |
| OLD | NEW |