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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_api.cc

Issue 19828006: Windows fix for exportSyncfsFolderToLocalFs API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 7 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/extensions/api/developer_private/developer_private_api. h" 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api. h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/app_restore_service.h" 8 #include "apps/app_restore_service.h"
9 #include "apps/saved_files_service.h" 9 #include "apps/saved_files_service.h"
10 #include "apps/shell_window.h" 10 #include "apps/shell_window.h"
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: 913 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction::
914 ClearPrexistingDirectoryContent, 914 ClearPrexistingDirectoryContent,
915 this, 915 this,
916 project_path)); 916 project_path));
917 917
918 return true; 918 return true;
919 } 919 }
920 920
921 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: 921 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction::
922 ClearPrexistingDirectoryContent(const base::FilePath& project_path) { 922 ClearPrexistingDirectoryContent(const base::FilePath& project_path) {
923 if (!base::DeleteFile(project_path, true/*recursive*/)) { 923
924 SetError("Error in copying files from sync filesystem."); 924 // Clear the project directory before copying new files.
925 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 925 base::DeleteFile(project_path, true/*recursive*/);
926 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction::
927 SendResponse,
928 this,
929 false));
930 return;
931 }
932 926
933 pendingCopyOperationsCount_ = 1; 927 pendingCopyOperationsCount_ = 1;
934 928
935 content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, 929 content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
936 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: 930 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction::
937 ReadSyncFileSystemDirectory, 931 ReadSyncFileSystemDirectory,
938 this, project_path, project_path.BaseName())); 932 this, project_path, project_path.BaseName()));
939 } 933 }
940 934
941 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: 935 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction::
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 1242
1249 #undef SET_STRING 1243 #undef SET_STRING
1250 return true; 1244 return true;
1251 } 1245 }
1252 1246
1253 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} 1247 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {}
1254 1248
1255 } // namespace api 1249 } // namespace api
1256 1250
1257 } // namespace extensions 1251 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698