| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/utility/media_galleries/picasa_albums_indexer.h" | 5 #include "chrome/utility/media_galleries/picasa_albums_indexer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 PicasaINIParser( | 26 PicasaINIParser( |
| 27 const base::FilePath& folder_path, AlbumImagesMap* albums_images) | 27 const base::FilePath& folder_path, AlbumImagesMap* albums_images) |
| 28 : folder_path_(folder_path), | 28 : folder_path_(folder_path), |
| 29 albums_images_(albums_images) { | 29 albums_images_(albums_images) { |
| 30 } | 30 } |
| 31 virtual ~PicasaINIParser() {} | 31 virtual ~PicasaINIParser() {} |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 virtual void HandleTriplet(const std::string& section, | 34 virtual void HandleTriplet(const std::string& section, |
| 35 const std::string& key, | 35 const std::string& key, |
| 36 const std::string& value) OVERRIDE { | 36 const std::string& value) override { |
| 37 if (key != kAlbumsKey) | 37 if (key != kAlbumsKey) |
| 38 return; | 38 return; |
| 39 | 39 |
| 40 // [.album:*] sections ignored as we get that data from the PMP files. | 40 // [.album:*] sections ignored as we get that data from the PMP files. |
| 41 if (section.find(kAlbumSectionHeader) == 0) | 41 if (section.find(kAlbumSectionHeader) == 0) |
| 42 return; | 42 return; |
| 43 | 43 |
| 44 std::vector<std::string> containing_albums; | 44 std::vector<std::string> containing_albums; |
| 45 base::SplitString(value, ',', &containing_albums); | 45 base::SplitString(value, ',', &containing_albums); |
| 46 for (std::vector<std::string>::iterator it = containing_albums.begin(); | 46 for (std::vector<std::string>::iterator it = containing_albums.begin(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 for (std::vector<picasa::FolderINIContents>::const_iterator it = | 104 for (std::vector<picasa::FolderINIContents>::const_iterator it = |
| 105 folders_inis_sorted.begin(); | 105 folders_inis_sorted.begin(); |
| 106 it != folders_inis_sorted.end(); | 106 it != folders_inis_sorted.end(); |
| 107 ++it) { | 107 ++it) { |
| 108 PicasaINIParser parser(it->folder_path, &albums_images_); | 108 PicasaINIParser parser(it->folder_path, &albums_images_); |
| 109 parser.Parse(it->ini_contents); | 109 parser.Parse(it->ini_contents); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace picasa | 113 } // namespace picasa |
| OLD | NEW |