| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/renderer/extensions/set_icon_natives.h" | 5 #include "chrome/renderer/extensions/set_icon_natives.h" |
| 6 | 6 |
| 7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/render_messages.h" |
| 8 #include "chrome/renderer/extensions/extension_request_sender.h" | 8 #include "chrome/renderer/extensions/extension_request_sender.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 extension_args->Get(v8::String::New("0"))->ToObject(); | 74 extension_args->Get(v8::String::New("0"))->ToObject(); |
| 75 | 75 |
| 76 DictionaryValue* dict = new DictionaryValue(); | 76 DictionaryValue* dict = new DictionaryValue(); |
| 77 dict->Set("imageData", bitmap_value); | 77 dict->Set("imageData", bitmap_value); |
| 78 | 78 |
| 79 if (details->Has(v8::String::New("tabId"))) { | 79 if (details->Has(v8::String::New("tabId"))) { |
| 80 dict->SetInteger("tabId", | 80 dict->SetInteger("tabId", |
| 81 details->Get(v8::String::New("tabId"))->Int32Value()); | 81 details->Get(v8::String::New("tabId"))->Int32Value()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 ListValue list_value; | 84 ListValue api_args; |
| 85 list_value.Append(dict); | 85 api_args.Append(dict); |
| 86 | 86 |
| 87 std::string name = *v8::String::AsciiValue(args[0]); | 87 std::string name = *v8::String::AsciiValue(args[0]); |
| 88 int request_id = args[2]->Int32Value(); | 88 bool has_callback = args[2]->BooleanValue(); |
| 89 bool has_callback = args[3]->BooleanValue(); | 89 bool for_io_thread = args[3]->BooleanValue(); |
| 90 bool for_io_thread = args[4]->BooleanValue(); | |
| 91 | 90 |
| 92 request_sender_->StartRequest(name, | 91 return v8::Integer::New(request_sender_->StartRequest( |
| 93 request_id, | 92 name, has_callback, for_io_thread, &api_args)); |
| 94 has_callback, | |
| 95 for_io_thread, | |
| 96 &list_value); | |
| 97 return v8::Undefined(); | |
| 98 } | 93 } |
| 99 | 94 |
| 100 } // namespace extensions | 95 } // namespace extensions |
| OLD | NEW |