| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/chrome_frame_test_utils.h" | 5 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 6 | 6 |
| 7 #include <atlapp.h> | 7 #include <atlapp.h> |
| 8 #include <atlmisc.h> | 8 #include <atlmisc.h> |
| 9 #include <iepmapi.h> | 9 #include <iepmapi.h> |
| 10 #include <sddl.h> | 10 #include <sddl.h> |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 return UTF8ToWide(gurl.PathForRequest()); | 484 return UTF8ToWide(gurl.PathForRequest()); |
| 485 } | 485 } |
| 486 | 486 |
| 487 std::wstring GetPathAndQueryFromUrl(const std::wstring& url) { | 487 std::wstring GetPathAndQueryFromUrl(const std::wstring& url) { |
| 488 string16 url16 = WideToUTF16(url); | 488 string16 url16 = WideToUTF16(url); |
| 489 GURL gurl = GURL(url16); | 489 GURL gurl = GURL(url16); |
| 490 return UTF8ToWide(gurl.PathForRequest()); | 490 return UTF8ToWide(gurl.PathForRequest()); |
| 491 } | 491 } |
| 492 | 492 |
| 493 std::wstring GetClipboardText() { | 493 std::wstring GetClipboardText() { |
| 494 ui::Clipboard clipboard; | |
| 495 string16 text16; | 494 string16 text16; |
| 496 clipboard.ReadText(ui::Clipboard::BUFFER_STANDARD, &text16); | 495 ui::Clipboard::GetForCurrentThread()->ReadText( |
| 496 ui::Clipboard::BUFFER_STANDARD, &text16); |
| 497 return UTF16ToWide(text16); | 497 return UTF16ToWide(text16); |
| 498 } | 498 } |
| 499 | 499 |
| 500 void SetClipboardText(const std::wstring& text) { | 500 void SetClipboardText(const std::wstring& text) { |
| 501 ui::Clipboard clipboard; | 501 ui::ScopedClipboardWriter clipboard_writer( |
| 502 { | 502 ui::Clipboard::GetForCurrentThread(), |
| 503 ui::ScopedClipboardWriter clipboard_writer(&clipboard, | 503 ui::Clipboard::BUFFER_STANDARD); |
| 504 ui::Clipboard::BUFFER_STANDARD); | 504 clipboard_writer.WriteText(WideToUTF16(text)); |
| 505 clipboard_writer.WriteText(WideToUTF16(text)); | |
| 506 } | |
| 507 } | 505 } |
| 508 | 506 |
| 509 bool AddCFMetaTag(std::string* html_data) { | 507 bool AddCFMetaTag(std::string* html_data) { |
| 510 if (!html_data) { | 508 if (!html_data) { |
| 511 NOTREACHED(); | 509 NOTREACHED(); |
| 512 return false; | 510 return false; |
| 513 } | 511 } |
| 514 std::string lower = StringToLowerASCII(*html_data); | 512 std::string lower = StringToLowerASCII(*html_data); |
| 515 size_t head = lower.find("<head>"); | 513 size_t head = lower.find("<head>"); |
| 516 if (head == std::string::npos) { | 514 if (head == std::string::npos) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 if (address.empty()) { | 698 if (address.empty()) { |
| 701 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be " | 699 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be " |
| 702 << "run over the loopback adapter, which may result in hangs."; | 700 << "run over the loopback adapter, which may result in hangs."; |
| 703 address.assign("127.0.0.1"); | 701 address.assign("127.0.0.1"); |
| 704 } | 702 } |
| 705 | 703 |
| 706 return address; | 704 return address; |
| 707 } | 705 } |
| 708 | 706 |
| 709 } // namespace chrome_frame_test | 707 } // namespace chrome_frame_test |
| OLD | NEW |