Index: ui/base/dragdrop/os_exchange_data_provider_factory.h |
diff --git a/ui/base/dragdrop/os_exchange_data_provider_factory.h b/ui/base/dragdrop/os_exchange_data_provider_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..670d1aa1c95c1809dfdd876dba193e2cfcd6fecc |
--- /dev/null |
+++ b/ui/base/dragdrop/os_exchange_data_provider_factory.h |
@@ -0,0 +1,32 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_FACTORY_H_ |
+#define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_FACTORY_H_ |
+ |
+#include "ui/base/dragdrop/os_exchange_data.h" |
+#include "ui/base/ui_base_export.h" |
+ |
+namespace ui { |
+ |
+// Builds OSExchangeDataProviders. We need to be able to switch providers at |
+// runtime based on the configuration flags. If no factory is set, |
+// CreateProvider() will default to the current operating system's default. |
+class UI_BASE_EXPORT OSExchangeDataProviderFactory { |
+ public: |
+ class Factory { |
+ public: |
+ virtual OSExchangeData::Provider* BuildProvider() = 0; |
sky
2016/07/25 22:44:56
Does it make sense for this or CreateProvider to r
Elliot Glaysher
2016/07/25 22:55:52
Added unique_ptr here, and then threaded that thro
|
+ }; |
+ |
+ // Sets the factory which builds the providers. |
+ static void SetFactory(Factory* factory); |
+ |
+ // Creates a Provider based on the current configuration. |
+ static OSExchangeData::Provider* CreateProvider(); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_FACTORY_H_ |