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

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

Issue 2837983002: Modify SetImageData to add additional items along with image data to save on clipboard. (Closed)
Patch Set: update open web solution timeline. Created 3 years, 7 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 "extensions/common/api/clipboard.h" 10 #include "extensions/common/api/clipboard.h"
11 #include "ui/base/clipboard/clipboard_observer.h" 11 #include "ui/base/clipboard/clipboard_observer.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 using AdditionalDataItemList = std::vector<api::clipboard::AdditionalDataItem>;
Devlin 2017/05/23 17:04:47 iwyu <vector>
jennyz 2017/05/23 21:36:39 Done.
16
15 class ClipboardAPI : public BrowserContextKeyedAPI, 17 class ClipboardAPI : public BrowserContextKeyedAPI,
16 public ui::ClipboardObserver { 18 public ui::ClipboardObserver {
17 public: 19 public:
18 explicit ClipboardAPI(content::BrowserContext* context); 20 explicit ClipboardAPI(content::BrowserContext* context);
19 ~ClipboardAPI() override; 21 ~ClipboardAPI() override;
20 22
21 // BrowserContextKeyedAPI implementation. 23 // BrowserContextKeyedAPI implementation.
22 static BrowserContextKeyedAPIFactory<ClipboardAPI>* GetFactoryInstance(); 24 static BrowserContextKeyedAPIFactory<ClipboardAPI>* GetFactoryInstance();
23 25
24 // ui::ClipboardObserver implementation. 26 // ui::ClipboardObserver implementation.
(...skipping 11 matching lines...) Expand all
36 class ClipboardSetImageDataFunction : public UIThreadExtensionFunction { 38 class ClipboardSetImageDataFunction : public UIThreadExtensionFunction {
37 public: 39 public:
38 DECLARE_EXTENSION_FUNCTION("clipboard.setImageData", CLIPBOARD_SETIMAGEDATA); 40 DECLARE_EXTENSION_FUNCTION("clipboard.setImageData", CLIPBOARD_SETIMAGEDATA);
39 41
40 protected: 42 protected:
41 ~ClipboardSetImageDataFunction() override; 43 ~ClipboardSetImageDataFunction() override;
42 ResponseAction Run() override; 44 ResponseAction Run() override;
43 45
44 void OnSaveImageDataSuccess(); 46 void OnSaveImageDataSuccess();
45 void OnSaveImageDataError(const std::string& error); 47 void OnSaveImageDataError(const std::string& error);
48
49 private:
50 bool IsAdditionalItemsParamValid(const AdditionalDataItemList& items);
46 }; 51 };
47 52
48 } // namespace extensions 53 } // namespace extensions
49 54
50 #endif // EXTENSIONS_BROWSER_API_CLIPBOARD_CLIPBOARD_API_H_ 55 #endif // EXTENSIONS_BROWSER_API_CLIPBOARD_CLIPBOARD_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698