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_album_table_reader.h" | 5 #include "chrome/utility/media_galleries/picasa_album_table_reader.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 !name_column.ReadString(i, &name) || name.empty() || | 84 !name_column.ReadString(i, &name) || name.empty() || |
85 !uid_column.ReadString(i, &uid) || uid.empty()) { | 85 !uid_column.ReadString(i, &uid) || uid.empty()) { |
86 continue; | 86 continue; |
87 } | 87 } |
88 | 88 |
89 base::Time timestamp = TimeFromMicrosoftVariantTime(date); | 89 base::Time timestamp = TimeFromMicrosoftVariantTime(date); |
90 | 90 |
91 if (category == kAlbumCategoryAlbum) { | 91 if (category == kAlbumCategoryAlbum) { |
92 std::string token; | 92 std::string token; |
93 if (!token_column.ReadString(i, &token) || token.empty() || | 93 if (!token_column.ReadString(i, &token) || token.empty() || |
94 !base::StartsWithASCII(token, kAlbumTokenPrefix, false)) { | 94 !base::StartsWith(token, kAlbumTokenPrefix, |
| 95 base::CompareCase::INSENSITIVE_ASCII)) { |
95 continue; | 96 continue; |
96 } | 97 } |
97 | 98 |
98 albums_.push_back(AlbumInfo(name, timestamp, uid, base::FilePath())); | 99 albums_.push_back(AlbumInfo(name, timestamp, uid, base::FilePath())); |
99 } else if (category == kAlbumCategoryFolder) { | 100 } else if (category == kAlbumCategoryFolder) { |
100 std::string filename; | 101 std::string filename; |
101 if (!filename_column.ReadString(i, &filename) || filename.empty()) | 102 if (!filename_column.ReadString(i, &filename) || filename.empty()) |
102 continue; | 103 continue; |
103 | 104 |
104 base::FilePath path = | 105 base::FilePath path = |
105 base::FilePath(base::FilePath::FromUTF8Unsafe(filename)); | 106 base::FilePath(base::FilePath::FromUTF8Unsafe(filename)); |
106 | 107 |
107 folders_.push_back(AlbumInfo(name, timestamp, uid, path)); | 108 folders_.push_back(AlbumInfo(name, timestamp, uid, path)); |
108 } | 109 } |
109 } | 110 } |
110 | 111 |
111 initialized_ = true; | 112 initialized_ = true; |
112 return true; | 113 return true; |
113 } | 114 } |
114 | 115 |
115 } // namespace picasa | 116 } // namespace picasa |
OLD | NEW |