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 "app/clipboard/clipboard_util_win.h" | 5 #include "app/clipboard/clipboard_util_win.h" |
6 | 6 |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 #include <shlwapi.h> | 8 #include <shlwapi.h> |
9 #include <wininet.h> | 9 #include <wininet.h> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/scoped_handle.h" | 13 #include "base/scoped_handle.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/utf_string_conversions.h" |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
18 bool GetUrlFromHDrop(IDataObject* data_object, std::wstring* url, | 19 bool GetUrlFromHDrop(IDataObject* data_object, std::wstring* url, |
19 std::wstring* title) { | 20 std::wstring* title) { |
20 DCHECK(data_object && url && title); | 21 DCHECK(data_object && url && title); |
21 | 22 |
22 STGMEDIUM medium; | 23 STGMEDIUM medium; |
23 if (FAILED(data_object->GetData(ClipboardUtil::GetCFHDropFormat(), &medium))) | 24 if (FAILED(data_object->GetData(ClipboardUtil::GetCFHDropFormat(), &medium))) |
24 return false; | 25 return false; |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos); | 519 size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos); |
519 fragment_end = cf_html.rfind('<', tag_end); | 520 fragment_end = cf_html.rfind('<', tag_end); |
520 } | 521 } |
521 if (fragment_start != std::string::npos && | 522 if (fragment_start != std::string::npos && |
522 fragment_end != std::string::npos) { | 523 fragment_end != std::string::npos) { |
523 *html = cf_html.substr(fragment_start, fragment_end - fragment_start); | 524 *html = cf_html.substr(fragment_start, fragment_end - fragment_start); |
524 TrimWhitespace(*html, TRIM_ALL, html); | 525 TrimWhitespace(*html, TRIM_ALL, html); |
525 } | 526 } |
526 } | 527 } |
527 } | 528 } |
OLD | NEW |