OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_SET_ICON_NATIVES_H_ | 5 #ifndef EXTENSIONS_RENDERER_SET_ICON_NATIVES_H_ |
6 #define EXTENSIONS_RENDERER_SET_ICON_NATIVES_H_ | 6 #define EXTENSIONS_RENDERER_SET_ICON_NATIVES_H_ |
7 | 7 |
| 8 #include "base/macros.h" |
8 #include "extensions/renderer/object_backed_native_handler.h" | 9 #include "extensions/renderer/object_backed_native_handler.h" |
9 #include "v8/include/v8.h" | 10 #include "v8/include/v8.h" |
10 | 11 |
11 namespace extensions { | 12 namespace extensions { |
12 class ScriptContext; | 13 class ScriptContext; |
13 | 14 |
14 // Functions exposed to extension JS to implement the setIcon extension API. | 15 // Functions exposed to extension JS to implement the setIcon extension API. |
15 class SetIconNatives : public ObjectBackedNativeHandler { | 16 class SetIconNatives : public ObjectBackedNativeHandler { |
16 public: | 17 public: |
17 explicit SetIconNatives(ScriptContext* context); | 18 explicit SetIconNatives(ScriptContext* context); |
18 | 19 |
19 private: | 20 private: |
20 bool ConvertImageDataToBitmapValue(const v8::Local<v8::Object> image_data, | 21 bool ConvertImageDataToBitmapValue(const v8::Local<v8::Object> image_data, |
21 v8::Local<v8::Value>* image_data_bitmap); | 22 v8::Local<v8::Value>* image_data_bitmap); |
22 bool ConvertImageDataSetToBitmapValueSet( | 23 bool ConvertImageDataSetToBitmapValueSet( |
23 v8::Local<v8::Object>& details, | 24 v8::Local<v8::Object>& details, |
24 v8::Local<v8::Object>* bitmap_set_value); | 25 v8::Local<v8::Object>* bitmap_set_value); |
25 void SetIconCommon(const v8::FunctionCallbackInfo<v8::Value>& args); | 26 void SetIconCommon(const v8::FunctionCallbackInfo<v8::Value>& args); |
26 | 27 |
27 DISALLOW_COPY_AND_ASSIGN(SetIconNatives); | 28 DISALLOW_COPY_AND_ASSIGN(SetIconNatives); |
28 }; | 29 }; |
29 | 30 |
30 } // namespace extensions | 31 } // namespace extensions |
31 | 32 |
32 #endif // EXTENSIONS_RENDERER_SET_ICON_NATIVES_H_ | 33 #endif // EXTENSIONS_RENDERER_SET_ICON_NATIVES_H_ |
OLD | NEW |