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/browser/media_galleries/fileapi/picasa_data_provider.h" | 5 #include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 void PicasaDataProvider::OnTempDirWatchStarted( | 129 void PicasaDataProvider::OnTempDirWatchStarted( |
130 scoped_ptr<base::FilePathWatcher> temp_dir_watcher) { | 130 scoped_ptr<base::FilePathWatcher> temp_dir_watcher) { |
131 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); | 131 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); |
132 temp_dir_watcher_.reset(temp_dir_watcher.release()); | 132 temp_dir_watcher_.reset(temp_dir_watcher.release()); |
133 } | 133 } |
134 | 134 |
135 void PicasaDataProvider::OnTempDirChanged(const base::FilePath& temp_dir_path, | 135 void PicasaDataProvider::OnTempDirChanged(const base::FilePath& temp_dir_path, |
136 bool error) { | 136 bool error) { |
137 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); | 137 DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread()); |
138 if (file_util::IsDirectoryEmpty(temp_dir_path)) | 138 if (base::IsDirectoryEmpty(temp_dir_path)) |
139 InvalidateData(); | 139 InvalidateData(); |
140 } | 140 } |
141 | 141 |
142 void PicasaDataProvider::DoRefreshIfNecessary() { | 142 void PicasaDataProvider::DoRefreshIfNecessary() { |
143 DCHECK(state_ != INVALID_DATA_STATE); | 143 DCHECK(state_ != INVALID_DATA_STATE); |
144 DCHECK(state_ != ALBUMS_IMAGES_FRESH_STATE); | 144 DCHECK(state_ != ALBUMS_IMAGES_FRESH_STATE); |
145 DCHECK(!(album_table_reader_ && albums_indexer_)); | 145 DCHECK(!(album_table_reader_ && albums_indexer_)); |
146 | 146 |
147 if (album_list_ready_callbacks_.empty() && | 147 if (album_list_ready_callbacks_.empty() && |
148 albums_index_ready_callbacks_.empty()) { | 148 albums_index_ready_callbacks_.empty()) { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 if (total_counts[name] != 1) { | 258 if (total_counts[name] != 1) { |
259 name = base::StringPrintf("%s (%d)", name.c_str(), | 259 name = base::StringPrintf("%s (%d)", name.c_str(), |
260 ++current_counts[name]); | 260 ++current_counts[name]); |
261 } | 261 } |
262 | 262 |
263 result_map->insert(std::pair<std::string, AlbumInfo>(name, info_list[i])); | 263 result_map->insert(std::pair<std::string, AlbumInfo>(name, info_list[i])); |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 } // namespace picasa | 267 } // namespace picasa |
OLD | NEW |