Home | History | Annotate | Download | only in media_galleries
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/utility/media_galleries/media_metadata_parser.h"
      6 
      7 #include "base/bind.h"
      8 #include "base/message_loop/message_loop.h"
      9 
     10 namespace metadata {
     11 
     12 MediaMetadataParser::MediaMetadataParser(DataReader* reader,
     13                                          const std::string& mime_type)
     14     : reader_(reader),
     15       metadata_(new MediaMetadata) {
     16   metadata_->mime_type = mime_type;
     17 }
     18 
     19 MediaMetadataParser::~MediaMetadataParser() {}
     20 
     21 void MediaMetadataParser::Start(const MetadataCallback& callback) {
     22   DCHECK(callback_.is_null());
     23   callback_ = callback;
     24 
     25   // TODO(tommycli): Implement for various mime types.
     26   callback_.Run(metadata_.Pass());
     27 }
     28 
     29 }  // namespace metadata
     30