Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: chrome/browser/chromeos/drive/drive_file_system.cc

Issue 11106009: drive: Add the local largest changestamp to chrome:drive-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/chromeos/drive/drive_file_system.h" 5 #include "chrome/browser/chromeos/drive/drive_file_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 2644
2645 // Add the file to the cache if we have uploaded a new file. 2645 // Add the file to the cache if we have uploaded a new file.
2646 cache_->StoreOnUIThread(params.resource_id, 2646 cache_->StoreOnUIThread(params.resource_id,
2647 params.md5, 2647 params.md5,
2648 params.file_content_path, 2648 params.file_content_path,
2649 DriveCache::FILE_OPERATION_MOVE, 2649 DriveCache::FILE_OPERATION_MOVE,
2650 base::Bind(&OnCacheUpdatedForAddUploadedFile, 2650 base::Bind(&OnCacheUpdatedForAddUploadedFile,
2651 params.callback)); 2651 params.callback));
2652 } 2652 }
2653 2653
2654 DriveFileSystemMetadata DriveFileSystem::GetMetadata() const {
Zachary Kuznia 2012/10/16 07:19:12 Since you're only returning the largest changestam
satorux1 2012/10/16 07:37:17 I'm going to expose some more metadata shortly to
2655 DriveFileSystemMetadata metadata;
2656 metadata.largest_changestamp = resource_metadata_->largest_changestamp();
2657 return metadata;
2658 }
2659
2654 void DriveFileSystem::Observe(int type, 2660 void DriveFileSystem::Observe(int type,
2655 const content::NotificationSource& source, 2661 const content::NotificationSource& source,
2656 const content::NotificationDetails& details) { 2662 const content::NotificationDetails& details) {
2657 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 2663 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
2658 2664
2659 if (type == chrome::NOTIFICATION_PREF_CHANGED) { 2665 if (type == chrome::NOTIFICATION_PREF_CHANGED) {
2660 PrefService* pref_service = profile_->GetPrefs(); 2666 PrefService* pref_service = profile_->GetPrefs();
2661 std::string* pref_name = content::Details<std::string>(details).ptr(); 2667 std::string* pref_name = content::Details<std::string>(details).ptr();
2662 if (*pref_name == prefs::kDisableGDataHostedFiles) { 2668 if (*pref_name == prefs::kDisableGDataHostedFiles) {
2663 SetHideHostedDocuments( 2669 SetHideHostedDocuments(
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 return; 3019 return;
3014 } 3020 }
3015 3021
3016 PlatformFileInfoProto entry_file_info; 3022 PlatformFileInfoProto entry_file_info;
3017 DriveEntry::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); 3023 DriveEntry::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info);
3018 *entry_proto->mutable_file_info() = entry_file_info; 3024 *entry_proto->mutable_file_info() = entry_file_info;
3019 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); 3025 callback.Run(DRIVE_FILE_OK, entry_proto.Pass());
3020 } 3026 }
3021 3027
3022 } // namespace drive 3028 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system.h ('k') | chrome/browser/chromeos/drive/drive_file_system_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698