OLD | NEW |
1 // Copyright (c) 2006-2008 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 #include "base/clipboard_util.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 | 15 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 file_contents->assign(data.get(), data.Size()); | 371 file_contents->assign(data.get(), data.Size()); |
372 } | 372 } |
373 ReleaseStgMedium(&content); | 373 ReleaseStgMedium(&content); |
374 } | 374 } |
375 | 375 |
376 STGMEDIUM description; | 376 STGMEDIUM description; |
377 if (SUCCEEDED(data_object->GetData(GetFileDescriptorFormat(), | 377 if (SUCCEEDED(data_object->GetData(GetFileDescriptorFormat(), |
378 &description))) { | 378 &description))) { |
379 ScopedHGlobal<FILEGROUPDESCRIPTOR> fgd(description.hGlobal); | 379 ScopedHGlobal<FILEGROUPDESCRIPTOR> fgd(description.hGlobal); |
380 // We expect there to be at least one file in here. | 380 // We expect there to be at least one file in here. |
381 DCHECK_GE(fgd->cItems, 1); | 381 DCHECK_GE(fgd->cItems, 1u); |
382 filename->assign(fgd->fgd[0].cFileName); | 382 filename->assign(fgd->fgd[0].cFileName); |
383 ReleaseStgMedium(&description); | 383 ReleaseStgMedium(&description); |
384 } | 384 } |
385 return true; | 385 return true; |
386 } | 386 } |
387 | 387 |
388 // HtmlToCFHtml and CFHtmlToHtml are based on similar methods in | 388 // HtmlToCFHtml and CFHtmlToHtml are based on similar methods in |
389 // WebCore/platform/win/ClipboardUtilitiesWin.cpp. | 389 // WebCore/platform/win/ClipboardUtilitiesWin.cpp. |
390 /* | 390 /* |
391 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 391 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 size_t fragment_start = cf_html.find('>', tag_start) + 1; | 493 size_t fragment_start = cf_html.find('>', tag_start) + 1; |
494 size_t tag_end = cf_html.rfind("EndFragment", std::string::npos); | 494 size_t tag_end = cf_html.rfind("EndFragment", std::string::npos); |
495 size_t fragment_end = cf_html.rfind('<', tag_end); | 495 size_t fragment_end = cf_html.rfind('<', tag_end); |
496 if (fragment_start != std::string::npos && | 496 if (fragment_start != std::string::npos && |
497 fragment_end != std::string::npos) { | 497 fragment_end != std::string::npos) { |
498 *html = cf_html.substr(fragment_start, fragment_end - fragment_start); | 498 *html = cf_html.substr(fragment_start, fragment_end - fragment_start); |
499 TrimWhitespace(*html, TRIM_ALL, html); | 499 TrimWhitespace(*html, TRIM_ALL, html); |
500 } | 500 } |
501 } | 501 } |
502 } | 502 } |
OLD | NEW |