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/safe_browsing/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 // an analog on non-Windows builds so just keep the name specified here. | 373 // an analog on non-Windows builds so just keep the name specified here. |
374 #if defined(OS_WIN) | 374 #if defined(OS_WIN) |
375 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 375 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
376 config.client_name = dist->GetSafeBrowsingName(); | 376 config.client_name = dist->GetSafeBrowsingName(); |
377 #else | 377 #else |
378 #if defined(GOOGLE_CHROME_BUILD) | 378 #if defined(GOOGLE_CHROME_BUILD) |
379 config.client_name = "googlechrome"; | 379 config.client_name = "googlechrome"; |
380 #else | 380 #else |
381 config.client_name = "chromium"; | 381 config.client_name = "chromium"; |
382 #endif | 382 #endif |
| 383 |
| 384 // Mark client string to allow server to differentiate mobile. |
| 385 #if defined(OS_ANDROID) |
| 386 config.client_name.append("-a"); |
| 387 #elif defined(OS_IOS) |
| 388 config.client_name.append("-i"); |
383 #endif | 389 #endif |
| 390 |
| 391 #endif // defined(OS_WIN) |
384 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 392 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
385 config.disable_auto_update = | 393 config.disable_auto_update = |
386 cmdline->HasSwitch(switches::kSbDisableAutoUpdate) || | 394 cmdline->HasSwitch(switches::kSbDisableAutoUpdate) || |
387 cmdline->HasSwitch(switches::kDisableBackgroundNetworking); | 395 cmdline->HasSwitch(switches::kDisableBackgroundNetworking); |
388 config.url_prefix = kSbDefaultURLPrefix; | 396 config.url_prefix = kSbDefaultURLPrefix; |
389 config.backup_connect_error_url_prefix = kSbBackupConnectErrorURLPrefix; | 397 config.backup_connect_error_url_prefix = kSbBackupConnectErrorURLPrefix; |
390 config.backup_http_error_url_prefix = kSbBackupHttpErrorURLPrefix; | 398 config.backup_http_error_url_prefix = kSbBackupHttpErrorURLPrefix; |
391 config.backup_network_error_url_prefix = kSbBackupNetworkErrorURLPrefix; | 399 config.backup_network_error_url_prefix = kSbBackupNetworkErrorURLPrefix; |
392 | 400 |
393 return config; | 401 return config; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 525 |
518 #if defined(FULL_SAFE_BROWSING) | 526 #if defined(FULL_SAFE_BROWSING) |
519 if (csd_service_) | 527 if (csd_service_) |
520 csd_service_->SetEnabledAndRefreshState(enable); | 528 csd_service_->SetEnabledAndRefreshState(enable); |
521 if (download_service_) | 529 if (download_service_) |
522 download_service_->SetEnabled(enable); | 530 download_service_->SetEnabled(enable); |
523 if (incident_service_) | 531 if (incident_service_) |
524 incident_service_->SetEnabled(enable); | 532 incident_service_->SetEnabled(enable); |
525 #endif | 533 #endif |
526 } | 534 } |
OLD | NEW |