| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlwin.h> | 8 #include <atlwin.h> |
| 9 #include <iepmapi.h> | 9 #include <iepmapi.h> |
| 10 #include <sddl.h> | 10 #include <sddl.h> |
| 11 | 11 |
| 12 #include "app/clipboard/clipboard.h" |
| 13 #include "app/clipboard/scoped_clipboard_writer.h" |
| 12 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 13 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 14 #include "base/file_version_info.h" | 16 #include "base/file_version_info.h" |
| 15 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 16 #include "base/process_util.h" | 18 #include "base/process_util.h" |
| 17 #include "base/scoped_handle.h" | 19 #include "base/scoped_handle.h" |
| 18 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
| 19 #include "base/string_util.h" | 21 #include "base/string_util.h" |
| 20 #include "base/stringprintf.h" | 22 #include "base/stringprintf.h" |
| 21 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 } | 466 } |
| 465 return UTF8ToWide(gurl.PathForRequest()); | 467 return UTF8ToWide(gurl.PathForRequest()); |
| 466 } | 468 } |
| 467 | 469 |
| 468 std::wstring GetPathAndQueryFromUrl(const std::wstring& url) { | 470 std::wstring GetPathAndQueryFromUrl(const std::wstring& url) { |
| 469 string16 url16 = WideToUTF16(url); | 471 string16 url16 = WideToUTF16(url); |
| 470 GURL gurl = GURL(url16); | 472 GURL gurl = GURL(url16); |
| 471 return UTF8ToWide(gurl.PathForRequest()); | 473 return UTF8ToWide(gurl.PathForRequest()); |
| 472 } | 474 } |
| 473 | 475 |
| 476 std::wstring GetClipboardText() { |
| 477 Clipboard clipboard; |
| 478 string16 text16; |
| 479 clipboard.ReadText(Clipboard::BUFFER_STANDARD, &text16); |
| 480 return UTF16ToWide(text16); |
| 481 } |
| 482 |
| 483 void SetClipboardText(const std::wstring& text) { |
| 484 Clipboard clipboard; |
| 485 { |
| 486 ScopedClipboardWriter clipboard_writer(&clipboard); |
| 487 clipboard_writer.WriteText(WideToUTF16(text)); |
| 488 } |
| 489 } |
| 490 |
| 474 bool AddCFMetaTag(std::string* html_data) { | 491 bool AddCFMetaTag(std::string* html_data) { |
| 475 if (!html_data) { | 492 if (!html_data) { |
| 476 NOTREACHED(); | 493 NOTREACHED(); |
| 477 return false; | 494 return false; |
| 478 } | 495 } |
| 479 std::string lower = StringToLowerASCII(*html_data); | 496 std::string lower = StringToLowerASCII(*html_data); |
| 480 size_t head = lower.find("<head>"); | 497 size_t head = lower.find("<head>"); |
| 481 if (head == std::string::npos) { | 498 if (head == std::string::npos) { |
| 482 // Add missing head section. | 499 // Add missing head section. |
| 483 size_t html = lower.find("<html>"); | 500 size_t html = lower.find("<html>"); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 // First check to see if it's even still running just to minimize the | 607 // First check to see if it's even still running just to minimize the |
| 591 // likelihood of spurious error messages from KillProcess. | 608 // likelihood of spurious error messages from KillProcess. |
| 592 if (WAIT_OBJECT_0 != ::WaitForSingleObject(crash_service, 0)) { | 609 if (WAIT_OBJECT_0 != ::WaitForSingleObject(crash_service, 0)) { |
| 593 base::KillProcess(crash_service, 0, false); | 610 base::KillProcess(crash_service, 0, false); |
| 594 } | 611 } |
| 595 return NULL; | 612 return NULL; |
| 596 } | 613 } |
| 597 } | 614 } |
| 598 | 615 |
| 599 } // namespace chrome_frame_test | 616 } // namespace chrome_frame_test |
| OLD | NEW |