| 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 #include "app/os_exchange_data_provider_win.h" | 5 #include "app/os_exchange_data_provider_win.h" |
| 6 | 6 |
| 7 #include "app/clipboard/clipboard_util_win.h" | 7 #include "app/clipboard/clipboard_util_win.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/i18n/file_util_icu.h" | 10 #include "base/i18n/file_util_icu.h" |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 ClipboardUtil::GetTextHtmlFormat()->cfFormat, storage_plain)); | 363 ClipboardUtil::GetTextHtmlFormat()->cfFormat, storage_plain)); |
| 364 } | 364 } |
| 365 | 365 |
| 366 bool OSExchangeDataProviderWin::GetString(std::wstring* data) const { | 366 bool OSExchangeDataProviderWin::GetString(std::wstring* data) const { |
| 367 return ClipboardUtil::GetPlainText(source_object_, data); | 367 return ClipboardUtil::GetPlainText(source_object_, data); |
| 368 } | 368 } |
| 369 | 369 |
| 370 bool OSExchangeDataProviderWin::GetURLAndTitle(GURL* url, | 370 bool OSExchangeDataProviderWin::GetURLAndTitle(GURL* url, |
| 371 std::wstring* title) const { | 371 std::wstring* title) const { |
| 372 std::wstring url_str; | 372 std::wstring url_str; |
| 373 bool success = ClipboardUtil::GetUrl(source_object_, &url_str, title); | 373 bool success = ClipboardUtil::GetUrl(source_object_, &url_str, title, true); |
| 374 if (success) { | 374 if (success) { |
| 375 GURL test_url(url_str); | 375 GURL test_url(url_str); |
| 376 if (test_url.is_valid()) { | 376 if (test_url.is_valid()) { |
| 377 *url = test_url; | 377 *url = test_url; |
| 378 return true; | 378 return true; |
| 379 } | 379 } |
| 380 } else if (GetPlainTextURL(source_object_, url)) { | 380 } else if (GetPlainTextURL(source_object_, url)) { |
| 381 title->clear(); | 381 title->clear(); |
| 382 return true; | 382 return true; |
| 383 } | 383 } |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 // static | 911 // static |
| 912 OSExchangeData::Provider* OSExchangeData::CreateProvider() { | 912 OSExchangeData::Provider* OSExchangeData::CreateProvider() { |
| 913 return new OSExchangeDataProviderWin(); | 913 return new OSExchangeDataProviderWin(); |
| 914 } | 914 } |
| 915 | 915 |
| 916 // static | 916 // static |
| 917 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat( | 917 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat( |
| 918 const std::string& type) { | 918 const std::string& type) { |
| 919 return RegisterClipboardFormat(ASCIIToWide(type).c_str()); | 919 return RegisterClipboardFormat(ASCIIToWide(type).c_str()); |
| 920 } | 920 } |
| OLD | NEW |