| 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/ui/navigation_correction_tab_observer.h" | 5 #include "chrome/browser/ui/navigation_correction_tab_observer.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/google/google_url_tracker_factory.h" | 9 #include "chrome/browser/google/google_url_tracker_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 base::Bind(&NavigationCorrectionTabObserver::OnEnabledChanged, | 35 base::Bind(&NavigationCorrectionTabObserver::OnEnabledChanged, |
| 36 base::Unretained(this))); | 36 base::Unretained(this))); |
| 37 } | 37 } |
| 38 | 38 |
| 39 GoogleURLTracker* google_url_tracker = | 39 GoogleURLTracker* google_url_tracker = |
| 40 GoogleURLTrackerFactory::GetForProfile(profile_); | 40 GoogleURLTrackerFactory::GetForProfile(profile_); |
| 41 if (google_url_tracker) { | 41 if (google_url_tracker) { |
| 42 if (google_util::IsGoogleDomainUrl(GetNavigationCorrectionURL(), | 42 if (google_util::IsGoogleDomainUrl(GetNavigationCorrectionURL(), |
| 43 google_util::ALLOW_SUBDOMAIN, | 43 google_util::ALLOW_SUBDOMAIN, |
| 44 google_util::ALLOW_NON_STANDARD_PORTS)) | 44 google_util::ALLOW_NON_STANDARD_PORTS)) |
| 45 google_url_tracker->RequestServerCheck(false); | 45 google_url_tracker->RequestServerCheck(); |
| 46 google_url_updated_subscription_ = google_url_tracker->RegisterCallback( | 46 google_url_updated_subscription_ = google_url_tracker->RegisterCallback( |
| 47 base::Bind(&NavigationCorrectionTabObserver::OnGoogleURLUpdated, | 47 base::Bind(&NavigationCorrectionTabObserver::OnGoogleURLUpdated, |
| 48 base::Unretained(this))); | 48 base::Unretained(this))); |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 NavigationCorrectionTabObserver::~NavigationCorrectionTabObserver() { | 52 NavigationCorrectionTabObserver::~NavigationCorrectionTabObserver() { |
| 53 } | 53 } |
| 54 | 54 |
| 55 // static | 55 // static |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 RenderFrameHost* render_frame_host) { | 98 RenderFrameHost* render_frame_host) { |
| 99 GURL google_base_url(UIThreadSearchTermsData(profile_).GoogleBaseURLValue()); | 99 GURL google_base_url(UIThreadSearchTermsData(profile_).GoogleBaseURLValue()); |
| 100 render_frame_host->Send(new ChromeViewMsg_SetNavigationCorrectionInfo( | 100 render_frame_host->Send(new ChromeViewMsg_SetNavigationCorrectionInfo( |
| 101 render_frame_host->GetRoutingID(), | 101 render_frame_host->GetRoutingID(), |
| 102 GetNavigationCorrectionURL(), | 102 GetNavigationCorrectionURL(), |
| 103 google_util::GetGoogleLocale(g_browser_process->GetApplicationLocale()), | 103 google_util::GetGoogleLocale(g_browser_process->GetApplicationLocale()), |
| 104 google_util::GetGoogleCountryCode(google_base_url), | 104 google_util::GetGoogleCountryCode(google_base_url), |
| 105 google_apis::GetAPIKey(), | 105 google_apis::GetAPIKey(), |
| 106 google_util::GetGoogleSearchURL(google_base_url))); | 106 google_util::GetGoogleSearchURL(google_base_url))); |
| 107 } | 107 } |
| OLD | NEW |