diff options
author | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-17 04:37:37 +0000 |
---|---|---|
committer | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-17 04:37:37 +0000 |
commit | 701a94eca898108d9c2db22137dcca5cc1670f3a (patch) | |
tree | 0755fe926595396a617356204177c66deb1bc439 /extensions/renderer/set_icon_natives.h | |
parent | ab0a831fea8167144a88f3157dfd776f654d057a (diff) | |
download | chromium_src-701a94eca898108d9c2db22137dcca5cc1670f3a.zip chromium_src-701a94eca898108d9c2db22137dcca5cc1670f3a.tar.gz chromium_src-701a94eca898108d9c2db22137dcca5cc1670f3a.tar.bz2 |
Move extensions bindings code out of //chrome
This moves several native handlers out of //chrome/renderer/extensions and into
//extensions/renderer.
Many of the changes are mechanical. Where applicable,
ChromeV8Extension has been wiped out.
BUG=359836
R=yoz@chromium.org
TBR=reed@google.com for skia +DEPS
TBR=ericu@chromium.org for fileapi +DEPS
TBR=eseidel@chromium.org for WebKit/public/platform +DEPS
TBR=sky@chromium.org for chrome/test
TBR=maruel@chromium.org for PRESUBMIT.py
Review URL: https://codereview.chromium.org/235943018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264413 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/renderer/set_icon_natives.h')
-rw-r--r-- | extensions/renderer/set_icon_natives.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/extensions/renderer/set_icon_natives.h b/extensions/renderer/set_icon_natives.h new file mode 100644 index 0000000..e5129dd --- /dev/null +++ b/extensions/renderer/set_icon_natives.h @@ -0,0 +1,40 @@ +// Copyright 2014 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 EXTENSIONS_RENDERER_SET_ICON_NATIVES_H_ +#define EXTENSIONS_RENDERER_SET_ICON_NATIVES_H_ + +#include "extensions/renderer/object_backed_native_handler.h" +#include "v8/include/v8.h" + +namespace base { +class DictionaryValue; +class Value; +} + +namespace extensions { +class RequestSender; +class ScriptContext; + +// Functions exposed to extension JS to implement the setIcon extension API. +class SetIconNatives : public ObjectBackedNativeHandler { + public: + SetIconNatives(RequestSender* request_sender, ScriptContext* context); + + private: + bool ConvertImageDataToBitmapValue(const v8::Local<v8::Object> image_data, + base::Value** bitmap_value); + bool ConvertImageDataSetToBitmapValueSet( + const v8::FunctionCallbackInfo<v8::Value>& args, + base::DictionaryValue* bitmap_value); + void SetIconCommon(const v8::FunctionCallbackInfo<v8::Value>& args); + + RequestSender* request_sender_; + + DISALLOW_COPY_AND_ASSIGN(SetIconNatives); +}; + +} // namespace extensions + +#endif // EXTENSIONS_RENDERER_SET_ICON_NATIVES_H_ |