| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_ | 5 #ifndef UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_ |
| 6 #define UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_ | 6 #define UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_ |
| 7 | 7 |
| 8 #include "ui/base/dragdrop/os_exchange_data.h" | 8 #include "ui/base/dragdrop/os_exchange_data.h" |
| 9 | 9 |
| 10 #include "mojo/public/cpp/bindings/map.h" | 10 #include "mojo/public/cpp/bindings/map.h" |
| 11 #include "ui/gfx/geometry/vector2d.h" | 11 #include "ui/gfx/geometry/vector2d.h" |
| 12 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
| 13 #include "ui/views/mus/mus_export.h" | 13 #include "ui/views/mus/mus_export.h" |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 | 16 |
| 17 // Translates chrome's requests for various data types to a platform specific | 17 // Translates chrome's requests for various data types to a platform specific |
| 18 // type. In the case of mus, this is a mapping of MIME types to byte arrays. | 18 // type. In the case of mus, this is a mapping of MIME types to byte arrays. |
| 19 // | 19 // |
| 20 // TODO(erg): In the long run, there's a lot of optimizations that we can do | 20 // TODO(erg): In the long run, there's a lot of optimizations that we can do |
| 21 // once everything targets mus. The entire model of OSExchangeDataProvider | 21 // once everything targets mus. The entire model of OSExchangeDataProvider |
| 22 // shoves all data across the wire at once whether it is needed or not. | 22 // shoves all data across the wire at once whether it is needed or not. |
| 23 class VIEWS_MUS_EXPORT OSExchangeDataProviderMus | 23 class VIEWS_MUS_EXPORT OSExchangeDataProviderMus |
| 24 : public ui::OSExchangeData::Provider { | 24 : public ui::OSExchangeData::Provider { |
| 25 public: | 25 public: |
| 26 using Data = std::map<std::string, std::vector<uint8_t>>; | 26 using Data = std::map<std::string, std::vector<uint8_t>>; |
| 27 | 27 |
| 28 OSExchangeDataProviderMus(); | 28 OSExchangeDataProviderMus(); |
| 29 OSExchangeDataProviderMus(const Data& data); |
| 29 ~OSExchangeDataProviderMus() override; | 30 ~OSExchangeDataProviderMus() override; |
| 30 | 31 |
| 31 // Returns the raw MIME type to data mapping. | 32 // Returns the raw MIME type to data mapping. |
| 32 Data GetData() const; | 33 Data GetData() const; |
| 33 | 34 |
| 34 // Overridden from OSExchangeData::Provider: | 35 // Overridden from OSExchangeData::Provider: |
| 35 std::unique_ptr<Provider> Clone() const override; | 36 std::unique_ptr<Provider> Clone() const override; |
| 36 | 37 |
| 37 void MarkOriginatedFromRenderer() override; | 38 void MarkOriginatedFromRenderer() override; |
| 38 bool DidOriginateFromRenderer() const override; | 39 bool DidOriginateFromRenderer() const override; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 gfx::Vector2d drag_image_offset_; | 103 gfx::Vector2d drag_image_offset_; |
| 103 | 104 |
| 104 Data mime_data_; | 105 Data mime_data_; |
| 105 | 106 |
| 106 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMus); | 107 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMus); |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace views | 110 } // namespace views |
| 110 | 111 |
| 111 #endif // UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_ | 112 #endif // UI_VIEWS_MUS_OS_EXCHANGE_DATA_PROVIDER_MUS_H_ |
| OLD | NEW |