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/metrics/variations/variations_service.h" | 5 #include "chrome/browser/metrics/variations/variations_service.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/build_time.h" | 9 #include "base/build_time.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 #if !defined(GOOGLE_CHROME_BUILD) | 482 #if !defined(GOOGLE_CHROME_BUILD) |
483 // Unless the URL was provided, unsupported builds should return NULL to | 483 // Unless the URL was provided, unsupported builds should return NULL to |
484 // indicate that the service should not be used. | 484 // indicate that the service should not be used. |
485 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 485 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
486 switches::kVariationsServerURL)) { | 486 switches::kVariationsServerURL)) { |
487 DVLOG(1) << "Not creating VariationsService in unofficial build without --" | 487 DVLOG(1) << "Not creating VariationsService in unofficial build without --" |
488 << switches::kVariationsServerURL << " specified."; | 488 << switches::kVariationsServerURL << " specified."; |
489 return result.Pass(); | 489 return result.Pass(); |
490 } | 490 } |
491 #endif | 491 #endif |
492 result.reset(new VariationsService( | 492 result.reset( |
493 new ResourceRequestAllowedNotifier, local_state, state_manager)); | 493 new VariationsService(new ResourceRequestAllowedNotifier(local_state), |
| 494 local_state, state_manager)); |
494 return result.Pass(); | 495 return result.Pass(); |
495 } | 496 } |
496 | 497 |
497 void VariationsService::DoActualFetch() { | 498 void VariationsService::DoActualFetch() { |
498 pending_seed_request_.reset(net::URLFetcher::Create( | 499 pending_seed_request_.reset(net::URLFetcher::Create( |
499 0, variations_server_url_, net::URLFetcher::GET, this)); | 500 0, variations_server_url_, net::URLFetcher::GET, this)); |
500 pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 501 pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | |
501 net::LOAD_DO_NOT_SAVE_COOKIES); | 502 net::LOAD_DO_NOT_SAVE_COOKIES); |
502 pending_seed_request_->SetRequestContext( | 503 pending_seed_request_->SetRequestContext( |
503 g_browser_process->system_request_context()); | 504 g_browser_process->system_request_context()); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 | 689 |
689 void VariationsService::RecordLastFetchTime() { | 690 void VariationsService::RecordLastFetchTime() { |
690 // local_state_ is NULL in tests, so check it first. | 691 // local_state_ is NULL in tests, so check it first. |
691 if (local_state_) { | 692 if (local_state_) { |
692 local_state_->SetInt64(prefs::kVariationsLastFetchTime, | 693 local_state_->SetInt64(prefs::kVariationsLastFetchTime, |
693 base::Time::Now().ToInternalValue()); | 694 base::Time::Now().ToInternalValue()); |
694 } | 695 } |
695 } | 696 } |
696 | 697 |
697 } // namespace chrome_variations | 698 } // namespace chrome_variations |
OLD | NEW |