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 // Implements the Chrome Extensions Media Galleries API. | 5 // Implements the Chrome Extensions Media Galleries API. |
6 | 6 |
7 #include "chrome/browser/extensions/api/media_galleries/media_galleries_api.h" | 7 #include "chrome/browser/extensions/api/media_galleries/media_galleries_api.h" |
8 | 8 |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 DCHECK_LT(attached_images_list->GetSize(), attached_images->size()); | 740 DCHECK_LT(attached_images_list->GetSize(), attached_images->size()); |
741 | 741 |
742 metadata::AttachedImage* current_image = | 742 metadata::AttachedImage* current_image = |
743 &(*attached_images)[blob_uuids->size()]; | 743 &(*attached_images)[blob_uuids->size()]; |
744 std::unique_ptr<base::DictionaryValue> attached_image( | 744 std::unique_ptr<base::DictionaryValue> attached_image( |
745 new base::DictionaryValue); | 745 new base::DictionaryValue); |
746 attached_image->Set(kBlobUUIDKey, new base::StringValue( | 746 attached_image->Set(kBlobUUIDKey, new base::StringValue( |
747 current_blob->GetUUID())); | 747 current_blob->GetUUID())); |
748 attached_image->Set(kTypeKey, new base::StringValue( | 748 attached_image->Set(kTypeKey, new base::StringValue( |
749 current_image->type)); | 749 current_image->type)); |
750 attached_image->Set(kSizeKey, new base::FundamentalValue( | 750 attached_image->Set( |
751 base::checked_cast<int>(current_image->data.size()))); | 751 kSizeKey, |
| 752 new base::Value(base::checked_cast<int>(current_image->data.size()))); |
752 attached_images_list->Append(std::move(attached_image)); | 753 attached_images_list->Append(std::move(attached_image)); |
753 | 754 |
754 blob_uuids->push_back(current_blob->GetUUID()); | 755 blob_uuids->push_back(current_blob->GetUUID()); |
755 | 756 |
756 content::RenderProcessHost* render_process_host = | 757 content::RenderProcessHost* render_process_host = |
757 render_frame_host()->GetProcess(); | 758 render_frame_host()->GetProcess(); |
758 if (!render_process_host) { | 759 if (!render_process_host) { |
759 SendResponse(false); | 760 SendResponse(false); |
760 return; | 761 return; |
761 } | 762 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 SendResponse(false); | 909 SendResponse(false); |
909 return; | 910 return; |
910 } | 911 } |
911 | 912 |
912 gallery_watch_manager()->RemoveWatch( | 913 gallery_watch_manager()->RemoveWatch( |
913 GetProfile(), extension_id(), gallery_pref_id); | 914 GetProfile(), extension_id(), gallery_pref_id); |
914 SendResponse(true); | 915 SendResponse(true); |
915 } | 916 } |
916 | 917 |
917 } // namespace extensions | 918 } // namespace extensions |
OLD | NEW |