| OLD | NEW |
| 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_integration_service.h" | 5 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/prefs/pref_change_registrar.h" | 9 #include "base/prefs/pref_change_registrar.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // both WAPI and Drive API. The user agent looks like: | 71 // both WAPI and Drive API. The user agent looks like: |
| 72 // | 72 // |
| 73 // chromedrive-<VERSION> chrome-cc/none (<OS_CPU_INFO>) | 73 // chromedrive-<VERSION> chrome-cc/none (<OS_CPU_INFO>) |
| 74 // chromedrive-24.0.1274.0 chrome-cc/none (CrOS x86_64 0.4.0) | 74 // chromedrive-24.0.1274.0 chrome-cc/none (CrOS x86_64 0.4.0) |
| 75 // | 75 // |
| 76 // TODO(satorux): Move this function to somewhere else: crbug.com/151605 | 76 // TODO(satorux): Move this function to somewhere else: crbug.com/151605 |
| 77 std::string GetDriveUserAgent() { | 77 std::string GetDriveUserAgent() { |
| 78 const char kDriveClientName[] = "chromedrive"; | 78 const char kDriveClientName[] = "chromedrive"; |
| 79 | 79 |
| 80 chrome::VersionInfo version_info; | 80 chrome::VersionInfo version_info; |
| 81 const std::string version = (version_info.is_valid() ? | 81 const std::string version = version_info.Version(); |
| 82 version_info.Version() : | |
| 83 std::string("unknown")); | |
| 84 | 82 |
| 85 // This part is <client_name>/<version>. | 83 // This part is <client_name>/<version>. |
| 86 const char kLibraryInfo[] = "chrome-cc/none"; | 84 const char kLibraryInfo[] = "chrome-cc/none"; |
| 87 | 85 |
| 88 const std::string os_cpu_info = content::BuildOSCpuInfo(); | 86 const std::string os_cpu_info = content::BuildOSCpuInfo(); |
| 89 | 87 |
| 90 // Add "gzip" to receive compressed data from the server. | 88 // Add "gzip" to receive compressed data from the server. |
| 91 // (see https://developers.google.com/drive/performance) | 89 // (see https://developers.google.com/drive/performance) |
| 92 return base::StringPrintf("%s-%s %s (%s) (gzip)", | 90 return base::StringPrintf("%s-%s %s (%s) (gzip)", |
| 93 kDriveClientName, | 91 kDriveClientName, |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 profile, preference_watcher, | 644 profile, preference_watcher, |
| 647 NULL, std::string(), base::FilePath(), NULL); | 645 NULL, std::string(), base::FilePath(), NULL); |
| 648 } else { | 646 } else { |
| 649 service = factory_for_test_->Run(profile); | 647 service = factory_for_test_->Run(profile); |
| 650 } | 648 } |
| 651 | 649 |
| 652 return service; | 650 return service; |
| 653 } | 651 } |
| 654 | 652 |
| 655 } // namespace drive | 653 } // namespace drive |
| OLD | NEW |