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/schema_generated_bindings.h" | 5 #include "chrome/renderer/extensions/schema_generated_bindings.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 | 640 |
641 // Construct the Value object. | 641 // Construct the Value object. |
642 IPC::Message bitmap_pickle; | 642 IPC::Message bitmap_pickle; |
643 IPC::WriteParam(&bitmap_pickle, bitmap); | 643 IPC::WriteParam(&bitmap_pickle, bitmap); |
644 *bitmap_value = base::BinaryValue::CreateWithCopiedBuffer( | 644 *bitmap_value = base::BinaryValue::CreateWithCopiedBuffer( |
645 static_cast<const char*>(bitmap_pickle.data()), bitmap_pickle.size()); | 645 static_cast<const char*>(bitmap_pickle.data()), bitmap_pickle.size()); |
646 | 646 |
647 return true; | 647 return true; |
648 } | 648 } |
649 | 649 |
650 // A special request for setting the extension action icon and the sidebar | 650 // A special request for setting the extension action icon. This function |
651 // mini tab icon. This function accepts a canvas ImageData object, so it needs | 651 // accepts a canvas ImageData object, so it needs to do extra processing |
652 // to do extra processing before sending the request to the browser. | 652 // before sending the request to the browser. |
653 static v8::Handle<v8::Value> SetIconCommon( | 653 static v8::Handle<v8::Value> SetIconCommon( |
654 const v8::Arguments& args) { | 654 const v8::Arguments& args) { |
655 Value* bitmap_value = NULL; | 655 Value* bitmap_value = NULL; |
656 if (!ConvertImageDataToBitmapValue(args, &bitmap_value)) | 656 if (!ConvertImageDataToBitmapValue(args, &bitmap_value)) |
657 return v8::Undefined(); | 657 return v8::Undefined(); |
658 | 658 |
659 v8::Local<v8::Object> extension_args = args[1]->ToObject(); | 659 v8::Local<v8::Object> extension_args = args[1]->ToObject(); |
660 v8::Local<v8::Object> details = | 660 v8::Local<v8::Object> details = |
661 extension_args->Get(v8::String::New("0"))->ToObject(); | 661 extension_args->Get(v8::String::New("0"))->ToObject(); |
662 | 662 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 const std::string& extension_id) { | 749 const std::string& extension_id) { |
750 for (PendingRequestMap::const_iterator it = g_pending_requests.Get().begin(); | 750 for (PendingRequestMap::const_iterator it = g_pending_requests.Get().begin(); |
751 it != g_pending_requests.Get().end(); ++it) { | 751 it != g_pending_requests.Get().end(); ++it) { |
752 if (it->second->extension_id == extension_id) | 752 if (it->second->extension_id == extension_id) |
753 return true; | 753 return true; |
754 } | 754 } |
755 return false; | 755 return false; |
756 } | 756 } |
757 | 757 |
758 } // namespace | 758 } // namespace |
OLD | NEW |