OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/base/dragdrop/os_exchange_data_provider_win.h" | 5 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 HRESULT __stdcall Clone(IEnumFORMATETC** clone); | 68 HRESULT __stdcall Clone(IEnumFORMATETC** clone); |
69 | 69 |
70 // IUnknown implementation: | 70 // IUnknown implementation: |
71 HRESULT __stdcall QueryInterface(const IID& iid, void** object); | 71 HRESULT __stdcall QueryInterface(const IID& iid, void** object); |
72 ULONG __stdcall AddRef(); | 72 ULONG __stdcall AddRef(); |
73 ULONG __stdcall Release(); | 73 ULONG __stdcall Release(); |
74 | 74 |
75 private: | 75 private: |
76 // This can only be called from |CloneFromOther|, since it initializes the | 76 // This can only be called from |CloneFromOther|, since it initializes the |
77 // contents_ from the other enumerator's contents. | 77 // contents_ from the other enumerator's contents. |
78 FormatEtcEnumerator() : ref_count_(0) { | 78 FormatEtcEnumerator() : cursor_(0), ref_count_(0) { |
79 } | 79 } |
80 | 80 |
81 // Clone a new FormatEtc from another instance of this enumeration. | 81 // Clone a new FormatEtc from another instance of this enumeration. |
82 static FormatEtcEnumerator* CloneFromOther(const FormatEtcEnumerator* other); | 82 static FormatEtcEnumerator* CloneFromOther(const FormatEtcEnumerator* other); |
83 | 83 |
84 private: | 84 private: |
85 // We are _forced_ to use a vector as our internal data model as Windows' | 85 // We are _forced_ to use a vector as our internal data model as Windows' |
86 // retarded IEnumFORMATETC API assumes a deterministic ordering of elements | 86 // retarded IEnumFORMATETC API assumes a deterministic ordering of elements |
87 // through methods like Next and Skip. This exposes the underlying data | 87 // through methods like Next and Skip. This exposes the underlying data |
88 // structure to the user. Bah. | 88 // structure to the user. Bah. |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 return new OSExchangeDataProviderWin(); | 942 return new OSExchangeDataProviderWin(); |
943 } | 943 } |
944 | 944 |
945 // static | 945 // static |
946 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat( | 946 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat( |
947 const std::string& type) { | 947 const std::string& type) { |
948 return RegisterClipboardFormat(ASCIIToUTF16(type).c_str()); | 948 return RegisterClipboardFormat(ASCIIToUTF16(type).c_str()); |
949 } | 949 } |
950 | 950 |
951 } // namespace ui | 951 } // namespace ui |
OLD | NEW |