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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 DCHECK_LT(attached_images_list->GetSize(), attached_images->size()); | 710 DCHECK_LT(attached_images_list->GetSize(), attached_images->size()); |
711 | 711 |
712 metadata::AttachedImage* current_image = | 712 metadata::AttachedImage* current_image = |
713 &(*attached_images)[blob_uuids->size()]; | 713 &(*attached_images)[blob_uuids->size()]; |
714 std::unique_ptr<base::DictionaryValue> attached_image( | 714 std::unique_ptr<base::DictionaryValue> attached_image( |
715 new base::DictionaryValue); | 715 new base::DictionaryValue); |
716 attached_image->Set(kBlobUUIDKey, new base::StringValue( | 716 attached_image->Set(kBlobUUIDKey, new base::StringValue( |
717 current_blob->GetUUID())); | 717 current_blob->GetUUID())); |
718 attached_image->Set(kTypeKey, new base::StringValue( | 718 attached_image->Set(kTypeKey, new base::StringValue( |
719 current_image->type)); | 719 current_image->type)); |
720 attached_image->Set(kSizeKey, new base::FundamentalValue( | 720 attached_image->Set(kSizeKey, new base::Value( |
721 base::checked_cast<int>(current_image->data.size()))); | 721 base::checked_cast<int>(current_image->data.size()))); |
722 attached_images_list->Append(std::move(attached_image)); | 722 attached_images_list->Append(std::move(attached_image)); |
723 | 723 |
724 blob_uuids->push_back(current_blob->GetUUID()); | 724 blob_uuids->push_back(current_blob->GetUUID()); |
725 extensions::BlobHolder* holder = | 725 extensions::BlobHolder* holder = |
726 extensions::BlobHolder::FromRenderProcessHost( | 726 extensions::BlobHolder::FromRenderProcessHost( |
727 render_frame_host()->GetProcess()); | 727 render_frame_host()->GetProcess()); |
728 holder->HoldBlobReference(std::move(current_blob)); | 728 holder->HoldBlobReference(std::move(current_blob)); |
729 | 729 |
730 // Construct the next Blob if necessary. | 730 // Construct the next Blob if necessary. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 SendResponse(false); | 871 SendResponse(false); |
872 return; | 872 return; |
873 } | 873 } |
874 | 874 |
875 gallery_watch_manager()->RemoveWatch( | 875 gallery_watch_manager()->RemoveWatch( |
876 GetProfile(), extension_id(), gallery_pref_id); | 876 GetProfile(), extension_id(), gallery_pref_id); |
877 SendResponse(true); | 877 SendResponse(true); |
878 } | 878 } |
879 | 879 |
880 } // namespace extensions | 880 } // namespace extensions |
OLD | NEW |