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 "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/google/google_profile_helper.h" | |
11 #include "chrome/browser/google/google_url_tracker_factory.h" | 10 #include "chrome/browser/google/google_url_tracker_factory.h" |
12 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
14 #include "chrome/common/render_messages.h" | 14 #include "chrome/common/render_messages.h" |
15 #include "components/google/core/browser/google_util.h" | 15 #include "components/google/core/browser/google_util.h" |
16 #include "components/pref_registry/pref_registry_syncable.h" | 16 #include "components/pref_registry/pref_registry_syncable.h" |
17 #include "content/public/browser/render_frame_host.h" | 17 #include "content/public/browser/render_frame_host.h" |
18 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
20 #include "google_apis/google_api_keys.h" | 20 #include "google_apis/google_api_keys.h" |
21 | 21 |
22 using content::RenderFrameHost; | 22 using content::RenderFrameHost; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 return google_util::LinkDoctorBaseURL(); | 88 return google_util::LinkDoctorBaseURL(); |
89 } | 89 } |
90 | 90 |
91 void NavigationCorrectionTabObserver::OnEnabledChanged() { | 91 void NavigationCorrectionTabObserver::OnEnabledChanged() { |
92 UpdateNavigationCorrectionInfo(web_contents()->GetRenderViewHost()); | 92 UpdateNavigationCorrectionInfo(web_contents()->GetRenderViewHost()); |
93 } | 93 } |
94 | 94 |
95 void NavigationCorrectionTabObserver::UpdateNavigationCorrectionInfo( | 95 void NavigationCorrectionTabObserver::UpdateNavigationCorrectionInfo( |
96 RenderViewHost* rvh) { | 96 RenderViewHost* rvh) { |
97 RenderFrameHost* rfh = rvh->GetMainFrame(); | 97 RenderFrameHost* rfh = rvh->GetMainFrame(); |
| 98 GURL google_base_url(UIThreadSearchTermsData(profile_).GoogleBaseURLValue()); |
98 rfh->Send(new ChromeViewMsg_SetNavigationCorrectionInfo( | 99 rfh->Send(new ChromeViewMsg_SetNavigationCorrectionInfo( |
99 rfh->GetRoutingID(), | 100 rfh->GetRoutingID(), |
100 GetNavigationCorrectionURL(), | 101 GetNavigationCorrectionURL(), |
101 google_util::GetGoogleLocale(g_browser_process->GetApplicationLocale()), | 102 google_util::GetGoogleLocale(g_browser_process->GetApplicationLocale()), |
102 google_util::GetGoogleCountryCode( | 103 google_util::GetGoogleCountryCode(google_base_url), |
103 google_profile_helper::GetGoogleHomePageURL(profile_)), | |
104 google_apis::GetAPIKey(), | 104 google_apis::GetAPIKey(), |
105 google_util::GetGoogleSearchURL( | 105 google_util::GetGoogleSearchURL(google_base_url))); |
106 google_profile_helper::GetGoogleHomePageURL(profile_)))); | |
107 } | 106 } |
OLD | NEW |