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

Side by Side Diff: extensions/browser/api/clipboard/clipboard_api.h

Issue 2379573008: Add SetImageData api to chrome.clipboard. (Closed)
Patch Set: Add a string for prompting clipboard write permission for installing chrome.clipboard. Created 4 years, 2 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
OLDNEW
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698