OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 | 642 |
643 // Construct the Value object. | 643 // Construct the Value object. |
644 IPC::Message bitmap_pickle; | 644 IPC::Message bitmap_pickle; |
645 IPC::WriteParam(&bitmap_pickle, bitmap); | 645 IPC::WriteParam(&bitmap_pickle, bitmap); |
646 *bitmap_value = base::BinaryValue::CreateWithCopiedBuffer( | 646 *bitmap_value = base::BinaryValue::CreateWithCopiedBuffer( |
647 static_cast<const char*>(bitmap_pickle.data()), bitmap_pickle.size()); | 647 static_cast<const char*>(bitmap_pickle.data()), bitmap_pickle.size()); |
648 | 648 |
649 return true; | 649 return true; |
650 } | 650 } |
651 | 651 |
652 // A special request for setting the extension action icon and the sidebar | 652 // A special request for setting the extension action icon. This function |
653 // mini tab icon. This function accepts a canvas ImageData object, so it needs | 653 // accepts a canvas ImageData object, so it needs to do extra processing |
654 // to do extra processing before sending the request to the browser. | 654 // before sending the request to the browser. |
655 static v8::Handle<v8::Value> SetIconCommon( | 655 static v8::Handle<v8::Value> SetIconCommon( |
656 const v8::Arguments& args) { | 656 const v8::Arguments& args) { |
657 Value* bitmap_value = NULL; | 657 Value* bitmap_value = NULL; |
658 if (!ConvertImageDataToBitmapValue(args, &bitmap_value)) | 658 if (!ConvertImageDataToBitmapValue(args, &bitmap_value)) |
659 return v8::Undefined(); | 659 return v8::Undefined(); |
660 | 660 |
661 v8::Local<v8::Object> extension_args = args[1]->ToObject(); | 661 v8::Local<v8::Object> extension_args = args[1]->ToObject(); |
662 v8::Local<v8::Object> details = | 662 v8::Local<v8::Object> details = |
663 extension_args->Get(v8::String::New("0"))->ToObject(); | 663 extension_args->Get(v8::String::New("0"))->ToObject(); |
664 | 664 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 const std::string& extension_id) { | 758 const std::string& extension_id) { |
759 for (PendingRequestMap::const_iterator it = g_pending_requests.Get().begin(); | 759 for (PendingRequestMap::const_iterator it = g_pending_requests.Get().begin(); |
760 it != g_pending_requests.Get().end(); ++it) { | 760 it != g_pending_requests.Get().end(); ++it) { |
761 if (it->second->extension_id == extension_id) | 761 if (it->second->extension_id == extension_id) |
762 return true; | 762 return true; |
763 } | 763 } |
764 return false; | 764 return false; |
765 } | 765 } |
766 | 766 |
767 } // namespace | 767 } // namespace |
OLD | NEW |