| 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" |
| 45 | 46 |
| 46 // Include without path to make GYP build see it. | 47 // Include without path to make GYP build see it. |
| 47 #include "chrome_tab.h" // NOLINT | 48 #include "chrome_tab.h" // NOLINT |
| 48 | 49 |
| 49 // Connection point class to support firing IChromeFrameEvents (dispinterface). | 50 // Connection point class to support firing IChromeFrameEvents (dispinterface). |
| 50 template<class T> | 51 template<class T> |
| 51 class ATL_NO_VTABLE ProxyDIChromeFrameEvents | 52 class ATL_NO_VTABLE ProxyDIChromeFrameEvents |
| 52 : public IConnectionPointImpl<T, &DIID_DIChromeFrameEvents> { | 53 : public IConnectionPointImpl<T, &DIID_DIChromeFrameEvents> { |
| 53 public: | 54 public: |
| 54 void FireMethodWithParams(ChromeFrameEventDispId dispid, | 55 void FireMethodWithParams(ChromeFrameEventDispId dispid, |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 if (request) { | 517 if (request) { |
| 517 static_cast<UrlmonUrlRequest*>(request)->TransferToHost(doc_site_); | 518 static_cast<UrlmonUrlRequest*>(request)->TransferToHost(doc_site_); |
| 518 } | 519 } |
| 519 automation_client_->RemoveRequest(request_id, false); | 520 automation_client_->RemoveRequest(request_id, false); |
| 520 } | 521 } |
| 521 | 522 |
| 522 virtual void OnSetCookieAsync(int tab_handle, const GURL& url, | 523 virtual void OnSetCookieAsync(int tab_handle, const GURL& url, |
| 523 const std::string& cookie) { | 524 const std::string& cookie) { |
| 524 std::string name; | 525 std::string name; |
| 525 std::string data; | 526 std::string data; |
| 527 |
| 526 size_t name_end = cookie.find('='); | 528 size_t name_end = cookie.find('='); |
| 527 if (std::string::npos != name_end) { | 529 if (std::string::npos != name_end) { |
| 528 name = cookie.substr(0, name_end); | 530 net::CookieMonster::ParsedCookie parsed_cookie = cookie; |
| 529 data = cookie.substr(name_end + 1); | 531 name = parsed_cookie.Name(); |
| 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); |
| 530 } else { | 538 } else { |
| 531 data = cookie; | 539 data = cookie; |
| 532 } | 540 } |
| 533 | 541 |
| 534 BOOL ret = InternetSetCookieA(url.spec().c_str(), name.c_str(), | 542 BOOL ret = InternetSetCookieA(url.spec().c_str(), name.c_str(), |
| 535 data.c_str()); | 543 data.c_str()); |
| 536 DCHECK(ret) << "InternetSetcookie failed. Error: " << GetLastError(); | 544 DCHECK(ret) << "InternetSetcookie failed. Error: " << GetLastError(); |
| 537 } | 545 } |
| 538 | 546 |
| 539 virtual void OnAttachExternalTab(int tab_handle, | 547 virtual void OnAttachExternalTab(int tab_handle, |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 EventHandlers onprivatemessage_; | 1140 EventHandlers onprivatemessage_; |
| 1133 EventHandlers onextensionready_; | 1141 EventHandlers onextensionready_; |
| 1134 | 1142 |
| 1135 // The UrlmonUrlRequest instance instantiated for downloading the base URL. | 1143 // The UrlmonUrlRequest instance instantiated for downloading the base URL. |
| 1136 scoped_refptr<CComObject<UrlmonUrlRequest> > base_url_request_; | 1144 scoped_refptr<CComObject<UrlmonUrlRequest> > base_url_request_; |
| 1137 | 1145 |
| 1138 base::Thread worker_thread_; | 1146 base::Thread worker_thread_; |
| 1139 }; | 1147 }; |
| 1140 | 1148 |
| 1141 #endif // CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ | 1149 #endif // CHROME_FRAME_CHROME_FRAME_ACTIVEX_BASE_H_ |
| OLD | NEW |