| 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/file_util.h" | 8 #include "base/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 22 matching lines...) Expand all Loading... |
| 33 #include "chrome/browser/profiles/profile.h" | 33 #include "chrome/browser/profiles/profile.h" |
| 34 #include "chrome/browser/signin/profile_oauth2_token_service.h" | 34 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
| 35 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 35 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 36 #include "chrome/browser/signin/signin_manager.h" | 36 #include "chrome/browser/signin/signin_manager.h" |
| 37 #include "chrome/browser/signin/signin_manager_factory.h" | 37 #include "chrome/browser/signin/signin_manager_factory.h" |
| 38 #include "chrome/common/chrome_version_info.h" | 38 #include "chrome/common/chrome_version_info.h" |
| 39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
| 40 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 40 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 41 #include "content/public/browser/browser_context.h" | 41 #include "content/public/browser/browser_context.h" |
| 42 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
| 43 #include "content/public/common/user_agent.h" |
| 43 #include "google_apis/drive/auth_service.h" | 44 #include "google_apis/drive/auth_service.h" |
| 44 #include "google_apis/drive/gdata_wapi_url_generator.h" | 45 #include "google_apis/drive/gdata_wapi_url_generator.h" |
| 45 #include "grit/generated_resources.h" | 46 #include "grit/generated_resources.h" |
| 46 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
| 47 #include "webkit/browser/fileapi/external_mount_points.h" | 48 #include "webkit/browser/fileapi/external_mount_points.h" |
| 48 #include "webkit/common/user_agent/user_agent_util.h" | |
| 49 | 49 |
| 50 using content::BrowserContext; | 50 using content::BrowserContext; |
| 51 using content::BrowserThread; | 51 using content::BrowserThread; |
| 52 | 52 |
| 53 namespace drive { | 53 namespace drive { |
| 54 namespace { | 54 namespace { |
| 55 | 55 |
| 56 // Name of the directory used to store metadata. | 56 // Name of the directory used to store metadata. |
| 57 const base::FilePath::CharType kMetadataDirectory[] = FILE_PATH_LITERAL("meta"); | 57 const base::FilePath::CharType kMetadataDirectory[] = FILE_PATH_LITERAL("meta"); |
| 58 | 58 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 75 const char kDriveClientName[] = "chromedrive"; | 75 const char kDriveClientName[] = "chromedrive"; |
| 76 | 76 |
| 77 chrome::VersionInfo version_info; | 77 chrome::VersionInfo version_info; |
| 78 const std::string version = (version_info.is_valid() ? | 78 const std::string version = (version_info.is_valid() ? |
| 79 version_info.Version() : | 79 version_info.Version() : |
| 80 std::string("unknown")); | 80 std::string("unknown")); |
| 81 | 81 |
| 82 // This part is <client_name>/<version>. | 82 // This part is <client_name>/<version>. |
| 83 const char kLibraryInfo[] = "chrome-cc/none"; | 83 const char kLibraryInfo[] = "chrome-cc/none"; |
| 84 | 84 |
| 85 const std::string os_cpu_info = webkit_glue::BuildOSCpuInfo(); | 85 const std::string os_cpu_info = content::BuildOSCpuInfo(); |
| 86 | 86 |
| 87 // Add "gzip" to receive compressed data from the server. | 87 // Add "gzip" to receive compressed data from the server. |
| 88 // (see https://developers.google.com/drive/performance) | 88 // (see https://developers.google.com/drive/performance) |
| 89 return base::StringPrintf("%s-%s %s (%s) (gzip)", | 89 return base::StringPrintf("%s-%s %s (%s) (gzip)", |
| 90 kDriveClientName, | 90 kDriveClientName, |
| 91 version.c_str(), | 91 version.c_str(), |
| 92 kLibraryInfo, | 92 kLibraryInfo, |
| 93 os_cpu_info.c_str()); | 93 os_cpu_info.c_str()); |
| 94 } | 94 } |
| 95 | 95 |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 profile, preference_watcher, | 626 profile, preference_watcher, |
| 627 NULL, std::string(), base::FilePath(), NULL); | 627 NULL, std::string(), base::FilePath(), NULL); |
| 628 } else { | 628 } else { |
| 629 service = factory_for_test_->Run(profile); | 629 service = factory_for_test_->Run(profile); |
| 630 } | 630 } |
| 631 | 631 |
| 632 return service; | 632 return service; |
| 633 } | 633 } |
| 634 | 634 |
| 635 } // namespace drive | 635 } // namespace drive |
| OLD | NEW |