| 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 | 5 |
| 6 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 6 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 357 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 358 std::string client_name(dist->GetSafeBrowsingName()); | 358 std::string client_name(dist->GetSafeBrowsingName()); |
| 359 #else | 359 #else |
| 360 #if defined(GOOGLE_CHROME_BUILD) | 360 #if defined(GOOGLE_CHROME_BUILD) |
| 361 std::string client_name("googlechrome"); | 361 std::string client_name("googlechrome"); |
| 362 #else | 362 #else |
| 363 std::string client_name("chromium"); | 363 std::string client_name("chromium"); |
| 364 #endif | 364 #endif |
| 365 #endif | 365 #endif |
| 366 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 366 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
| 367 bool disable_auto_update = cmdline->HasSwitch(switches::kSbDisableAutoUpdate); | 367 bool disable_auto_update = |
| 368 cmdline->HasSwitch(switches::kSbDisableAutoUpdate) || |
| 369 cmdline->HasSwitch(switches::kDisableBackgroundNetworking); |
| 368 std::string info_url_prefix = | 370 std::string info_url_prefix = |
| 369 cmdline->HasSwitch(switches::kSbInfoURLPrefix) ? | 371 cmdline->HasSwitch(switches::kSbInfoURLPrefix) ? |
| 370 cmdline->GetSwitchValueASCII(switches::kSbInfoURLPrefix) : | 372 cmdline->GetSwitchValueASCII(switches::kSbInfoURLPrefix) : |
| 371 kSbDefaultInfoURLPrefix; | 373 kSbDefaultInfoURLPrefix; |
| 372 std::string mackey_url_prefix = | 374 std::string mackey_url_prefix = |
| 373 cmdline->HasSwitch(switches::kSbMacKeyURLPrefix) ? | 375 cmdline->HasSwitch(switches::kSbMacKeyURLPrefix) ? |
| 374 cmdline->GetSwitchValueASCII(switches::kSbMacKeyURLPrefix) : | 376 cmdline->GetSwitchValueASCII(switches::kSbMacKeyURLPrefix) : |
| 375 kSbDefaultMacKeyURLPrefix; | 377 kSbDefaultMacKeyURLPrefix; |
| 376 | 378 |
| 377 protocol_manager_ = new SafeBrowsingProtocolManager(this, | 379 protocol_manager_ = new SafeBrowsingProtocolManager(this, |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 if (!full_hits.empty()) | 811 if (!full_hits.empty()) |
| 810 return; | 812 return; |
| 811 } | 813 } |
| 812 | 814 |
| 813 DLOG(INFO) << "ReportMalware: " << malware_url << " " << page_url << " " << | 815 DLOG(INFO) << "ReportMalware: " << malware_url << " " << page_url << " " << |
| 814 referrer_url << " " << is_subresource; | 816 referrer_url << " " << is_subresource; |
| 815 | 817 |
| 816 protocol_manager_->ReportMalware(malware_url, page_url, referrer_url, | 818 protocol_manager_->ReportMalware(malware_url, page_url, referrer_url, |
| 817 is_subresource); | 819 is_subresource); |
| 818 } | 820 } |
| OLD | NEW |