Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: app/os_exchange_data_provider_win.cc

Issue 1619023: Fix 2 drag-out problems:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/views/tab_contents/tab_contents_drag_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 // yet, it probably means that the target does not support delay- 626 // yet, it probably means that the target does not support delay-
627 // rendering. So instead, we wait for the data. 627 // rendering. So instead, we wait for the data.
628 if (is_left_button_down) { 628 if (is_left_button_down) {
629 (*iter)->in_delay_rendering = true; 629 (*iter)->in_delay_rendering = true;
630 memset(medium, 0, sizeof(STGMEDIUM)); 630 memset(medium, 0, sizeof(STGMEDIUM));
631 } else { 631 } else {
632 wait_for_data = true; 632 wait_for_data = true;
633 } 633 }
634 } 634 }
635 635
636 if (wait_for_data) { 636 if (!wait_for_data)
637 // Notify the observer we start waiting for the data. This gives 637 return DV_E_FORMATETC;
638 // an observer a chance to end the drag and drop.
639 if (observer_)
640 observer_->OnWaitForData();
641 638
642 // Now we can start the download. 639 // Notify the observer we start waiting for the data. This gives
643 if ((*iter)->downloader.get()) { 640 // an observer a chance to end the drag and drop.
644 if (!(*iter)->downloader->Start(this)) { 641 if (observer_)
645 is_aborting_ = true; 642 observer_->OnWaitForData();
646 return DV_E_FORMATETC; 643
647 } 644 // Now we can start the download.
645 if ((*iter)->downloader.get()) {
646 if (!(*iter)->downloader->Start(this)) {
647 is_aborting_ = true;
648 return DV_E_FORMATETC;
648 } 649 }
650 }
649 651
650 // The stored data should have been updated with the final version. 652 // The stored data should have been updated with the final version.
651 // So we just need to call this function again to retrieve it. 653 // So we just need to call this function again to retrieve it.
652 return GetData(format_etc, medium); 654 return GetData(format_etc, medium);
653 }
654 } 655 }
655 return S_OK; 656 return S_OK;
656 } 657 }
657 ++iter; 658 ++iter;
658 } 659 }
659 660
660 return DV_E_FORMATETC; 661 return DV_E_FORMATETC;
661 } 662 }
662 663
663 HRESULT DataObjectImpl::GetDataHere(FORMATETC* format_etc, 664 HRESULT DataObjectImpl::GetDataHere(FORMATETC* format_etc,
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 // static 910 // static
910 OSExchangeData::Provider* OSExchangeData::CreateProvider() { 911 OSExchangeData::Provider* OSExchangeData::CreateProvider() {
911 return new OSExchangeDataProviderWin(); 912 return new OSExchangeDataProviderWin();
912 } 913 }
913 914
914 // static 915 // static
915 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat( 916 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat(
916 const std::string& type) { 917 const std::string& type) {
917 return RegisterClipboardFormat(ASCIIToWide(type).c_str()); 918 return RegisterClipboardFormat(ASCIIToWide(type).c_str());
918 } 919 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/views/tab_contents/tab_contents_drag_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698