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/google/google_url_tracker.h" | 5 #include "chrome/browser/google/google_url_tracker.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/google/google_url_tracker_factory.h" | 10 #include "chrome/browser/google/google_url_tracker_factory.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 net::URLFetcher::GET, this)); | 322 net::URLFetcher::GET, this)); |
323 ++fetcher_id_; | 323 ++fetcher_id_; |
324 // We don't want this fetch to set new entries in the cache or cookies, lest | 324 // We don't want this fetch to set new entries in the cache or cookies, lest |
325 // we alarm the user. | 325 // we alarm the user. |
326 fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE | | 326 fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE | |
327 net::LOAD_DO_NOT_SAVE_COOKIES); | 327 net::LOAD_DO_NOT_SAVE_COOKIES); |
328 fetcher_->SetRequestContext(profile_->GetRequestContext()); | 328 fetcher_->SetRequestContext(profile_->GetRequestContext()); |
329 | 329 |
330 // Configure to max_retries at most kMaxRetries times for 5xx errors. | 330 // Configure to max_retries at most kMaxRetries times for 5xx errors. |
331 static const int kMaxRetries = 5; | 331 static const int kMaxRetries = 5; |
332 fetcher_->SetMaxRetries(kMaxRetries); | 332 fetcher_->SetMaxRetriesOn5xx(kMaxRetries); |
333 | 333 |
334 fetcher_->Start(); | 334 fetcher_->Start(); |
335 } | 335 } |
336 | 336 |
337 void GoogleURLTracker::SearchCommitted() { | 337 void GoogleURLTracker::SearchCommitted() { |
338 if (need_to_prompt_) { | 338 if (need_to_prompt_) { |
339 search_committed_ = true; | 339 search_committed_ = true; |
340 // These notifications will fire a bit later in the same call chain we're | 340 // These notifications will fire a bit later in the same call chain we're |
341 // currently in. | 341 // currently in. |
342 if (!registrar_.IsRegistered(this, content::NOTIFICATION_NAV_ENTRY_PENDING, | 342 if (!registrar_.IsRegistered(this, content::NOTIFICATION_NAV_ENTRY_PENDING, |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 } | 523 } |
524 if (registrar_.IsRegistered(this, content::NOTIFICATION_NAV_ENTRY_PENDING, | 524 if (registrar_.IsRegistered(this, content::NOTIFICATION_NAV_ENTRY_PENDING, |
525 content::NotificationService::AllBrowserContextsAndSources())) { | 525 content::NotificationService::AllBrowserContextsAndSources())) { |
526 DCHECK(!search_committed_); | 526 DCHECK(!search_committed_); |
527 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING, | 527 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING, |
528 content::NotificationService::AllBrowserContextsAndSources()); | 528 content::NotificationService::AllBrowserContextsAndSources()); |
529 registrar_.Remove(this, chrome::NOTIFICATION_INSTANT_COMMITTED, | 529 registrar_.Remove(this, chrome::NOTIFICATION_INSTANT_COMMITTED, |
530 content::NotificationService::AllBrowserContextsAndSources()); | 530 content::NotificationService::AllBrowserContextsAndSources()); |
531 } | 531 } |
532 } | 532 } |
OLD | NEW |