| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 |
| 7 #include <algorithm> |
| 8 |
| 6 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 7 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
| 8 #include "base/task.h" | 11 #include "base/task.h" |
| 9 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_version_info.h" | |
| 11 #include "chrome/browser/chrome_thread.h" | 13 #include "chrome/browser/chrome_thread.h" |
| 12 #include "chrome/browser/profile.h" | 14 #include "chrome/browser/profile.h" |
| 13 #include "chrome/browser/sync/engine/syncapi.h" | 15 #include "chrome/browser/sync/engine/syncapi.h" |
| 14 #include "chrome/browser/sync/glue/change_processor.h" | 16 #include "chrome/browser/sync/glue/change_processor.h" |
| 15 #include "chrome/browser/sync/glue/database_model_worker.h" | 17 #include "chrome/browser/sync/glue/database_model_worker.h" |
| 16 #include "chrome/browser/sync/glue/history_model_worker.h" | 18 #include "chrome/browser/sync/glue/history_model_worker.h" |
| 17 #include "chrome/browser/sync/glue/sync_backend_host.h" | 19 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 18 #include "chrome/browser/sync/glue/http_bridge.h" | 20 #include "chrome/browser/sync/glue/http_bridge.h" |
| 19 #include "chrome/browser/sync/glue/password_model_worker.h" | 21 #include "chrome/browser/sync/glue/password_model_worker.h" |
| 20 #include "chrome/browser/sync/sessions/session_state.h" | 22 #include "chrome/browser/sync/sessions/session_state.h" |
| 23 #include "chrome/common/chrome_version_info.h" |
| 21 #include "chrome/common/notification_service.h" | 24 #include "chrome/common/notification_service.h" |
| 22 #include "chrome/common/notification_type.h" | 25 #include "chrome/common/notification_type.h" |
| 23 #include "webkit/glue/webkit_glue.h" | 26 #include "webkit/glue/webkit_glue.h" |
| 24 | 27 |
| 25 static const int kSaveChangesIntervalSeconds = 10; | 28 static const int kSaveChangesIntervalSeconds = 10; |
| 26 static const char kGaiaServiceId[] = "chromiumsync"; | 29 static const char kGaiaServiceId[] = "chromiumsync"; |
| 27 static const char kGaiaSourceForChrome[] = "ChromiumBrowser"; | 30 static const char kGaiaSourceForChrome[] = "ChromiumBrowser"; |
| 28 static const FilePath::CharType kSyncDataFolderName[] = | 31 static const FilePath::CharType kSyncDataFolderName[] = |
| 29 FILE_PATH_LITERAL("Sync Data"); | 32 FILE_PATH_LITERAL("Sync Data"); |
| 30 | 33 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 user_agent += "WIN "; | 358 user_agent += "WIN "; |
| 356 #elif defined(OS_LINUX) | 359 #elif defined(OS_LINUX) |
| 357 user_agent += "LINUX "; | 360 user_agent += "LINUX "; |
| 358 #elif defined(OS_FREEBSD) | 361 #elif defined(OS_FREEBSD) |
| 359 user_agent += "FREEBSD "; | 362 user_agent += "FREEBSD "; |
| 360 #elif defined(OS_OPENBSD) | 363 #elif defined(OS_OPENBSD) |
| 361 user_agent += "OPENBSD "; | 364 user_agent += "OPENBSD "; |
| 362 #elif defined(OS_MACOSX) | 365 #elif defined(OS_MACOSX) |
| 363 user_agent += "MAC "; | 366 user_agent += "MAC "; |
| 364 #endif | 367 #endif |
| 365 scoped_ptr<FileVersionInfo> version_info( | 368 scoped_ptr<FileVersionInfo> version_info(chrome::GetChromeVersionInfo()); |
| 366 chrome_app::GetChromeVersionInfo()); | |
| 367 if (version_info == NULL) { | 369 if (version_info == NULL) { |
| 368 DLOG(ERROR) << "Unable to create FileVersionInfo object"; | 370 DLOG(ERROR) << "Unable to create FileVersionInfo object"; |
| 369 return user_agent; | 371 return user_agent; |
| 370 } | 372 } |
| 371 | 373 |
| 372 user_agent += WideToASCII(version_info->product_version()); | 374 user_agent += WideToASCII(version_info->product_version()); |
| 373 user_agent += " (" + WideToASCII(version_info->last_change()) + ")"; | 375 user_agent += " (" + WideToASCII(version_info->last_change()) + ")"; |
| 374 if (!version_info->is_official_build()) | 376 if (!version_info->is_official_build()) |
| 375 user_agent += "-devel"; | 377 user_agent += "-devel"; |
| 376 return user_agent; | 378 return user_agent; |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 646 } |
| 645 | 647 |
| 646 void SyncBackendHost::Core::DeleteSyncDataFolder() { | 648 void SyncBackendHost::Core::DeleteSyncDataFolder() { |
| 647 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { | 649 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { |
| 648 if (!file_util::Delete(host_->sync_data_folder_path(), true)) | 650 if (!file_util::Delete(host_->sync_data_folder_path(), true)) |
| 649 LOG(DFATAL) << "Could not delete the Sync Data folder."; | 651 LOG(DFATAL) << "Could not delete the Sync Data folder."; |
| 650 } | 652 } |
| 651 } | 653 } |
| 652 | 654 |
| 653 } // namespace browser_sync | 655 } // namespace browser_sync |
| OLD | NEW |