| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 EXTENSIONS_BROWSER_API_CLIPBOARD_CLIPBOARD_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_CLIPBOARD_CLIPBOARD_API_H_ |
| 6 #define EXTENSIONS_BROWSER_API_CLIPBOARD_CLIPBOARD_API_H_ | 6 #define EXTENSIONS_BROWSER_API_CLIPBOARD_CLIPBOARD_API_H_ |
| 7 | 7 |
| 8 #include "extensions/browser/browser_context_keyed_api_factory.h" | 8 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 9 #include "extensions/browser/extension_function.h" | 9 #include "extensions/browser/extension_function.h" |
| 10 #include "ui/base/clipboard/clipboard_observer.h" | 10 #include "ui/base/clipboard/clipboard_observer.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 friend class BrowserContextKeyedAPIFactory<ClipboardAPI>; | 27 friend class BrowserContextKeyedAPIFactory<ClipboardAPI>; |
| 28 | 28 |
| 29 // BrowserContextKeyedAPI implementation. | 29 // BrowserContextKeyedAPI implementation. |
| 30 static const char* service_name() { return "ClipboardAPI"; } | 30 static const char* service_name() { return "ClipboardAPI"; } |
| 31 | 31 |
| 32 content::BrowserContext* const browser_context_; | 32 content::BrowserContext* const browser_context_; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 class ClipboardSetImageDataFunction : public UIThreadExtensionFunction { |
| 36 public: |
| 37 DECLARE_EXTENSION_FUNCTION("clipboard.setImageData", CLIPBOARD_SETIMAGEDATA); |
| 38 |
| 39 protected: |
| 40 ~ClipboardSetImageDataFunction() override; |
| 41 ResponseAction Run() override; |
| 42 |
| 43 void SaveImageData(const std::vector<char>& image_data, |
| 44 const std::string& type); |
| 45 void OnSaveImageDataSuccess(); |
| 46 void OnSaveImageDataError(); |
| 47 }; |
| 48 |
| 35 } // namespace extensions | 49 } // namespace extensions |
| 36 | 50 |
| 37 #endif // EXTENSIONS_BROWSER_API_CLIPBOARD_CLIPBOARD_API_H_ | 51 #endif // EXTENSIONS_BROWSER_API_CLIPBOARD_CLIPBOARD_API_H_ |
| OLD | NEW |