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

Side by Side Diff: extensions/renderer/set_icon_natives.cc

Issue 1964483002: Revert of [Extensions] Update more bindings and allow for multiple feature access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « extensions/renderer/object_backed_native_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "extensions/renderer/set_icon_natives.h" 5 #include "extensions/renderer/set_icon_natives.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 15 matching lines...) Expand all
26 const char kNoMemory[] = "Chrome was unable to initialize icon."; 26 const char kNoMemory[] = "Chrome was unable to initialize icon.";
27 27
28 } // namespace 28 } // namespace
29 29
30 namespace extensions { 30 namespace extensions {
31 31
32 SetIconNatives::SetIconNatives(ScriptContext* context) 32 SetIconNatives::SetIconNatives(ScriptContext* context)
33 : ObjectBackedNativeHandler(context) { 33 : ObjectBackedNativeHandler(context) {
34 RouteFunction( 34 RouteFunction(
35 "SetIconCommon", 35 "SetIconCommon",
36 {"declarativeContent", "pageAction", "browserAction", "systemIndicator"},
37 base::Bind(&SetIconNatives::SetIconCommon, base::Unretained(this))); 36 base::Bind(&SetIconNatives::SetIconCommon, base::Unretained(this)));
38 } 37 }
39 38
40 bool SetIconNatives::ConvertImageDataToBitmapValue( 39 bool SetIconNatives::ConvertImageDataToBitmapValue(
41 const v8::Local<v8::Object> image_data, 40 const v8::Local<v8::Object> image_data,
42 v8::Local<v8::Value>* image_data_bitmap) { 41 v8::Local<v8::Value>* image_data_bitmap) {
43 v8::Isolate* isolate = context()->v8_context()->GetIsolate(); 42 v8::Isolate* isolate = context()->v8_context()->GetIsolate();
44 v8::Local<v8::Object> data = 43 v8::Local<v8::Object> data =
45 image_data->Get(v8::String::NewFromUtf8(isolate, "data")) 44 image_data->Get(v8::String::NewFromUtf8(isolate, "data"))
46 ->ToObject(isolate); 45 ->ToObject(isolate);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 bitmap_set_value); 146 bitmap_set_value);
148 if (details->Has(v8::String::NewFromUtf8(args.GetIsolate(), "tabId"))) { 147 if (details->Has(v8::String::NewFromUtf8(args.GetIsolate(), "tabId"))) {
149 dict->Set( 148 dict->Set(
150 v8::String::NewFromUtf8(args.GetIsolate(), "tabId"), 149 v8::String::NewFromUtf8(args.GetIsolate(), "tabId"),
151 details->Get(v8::String::NewFromUtf8(args.GetIsolate(), "tabId"))); 150 details->Get(v8::String::NewFromUtf8(args.GetIsolate(), "tabId")));
152 } 151 }
153 args.GetReturnValue().Set(dict); 152 args.GetReturnValue().Set(dict);
154 } 153 }
155 154
156 } // namespace extensions 155 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/object_backed_native_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698