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/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/google/google_profile_helper.h" |
9 #include "chrome/browser/google/google_url_tracker_factory.h" | 10 #include "chrome/browser/google/google_url_tracker_factory.h" |
10 #include "chrome/browser/google/google_util.h" | 11 #include "chrome/browser/google/google_util.h" |
11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
13 #include "chrome/common/render_messages.h" | 14 #include "chrome/common/render_messages.h" |
14 #include "components/pref_registry/pref_registry_syncable.h" | 15 #include "components/pref_registry/pref_registry_syncable.h" |
15 #include "content/public/browser/render_frame_host.h" | 16 #include "content/public/browser/render_frame_host.h" |
16 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
17 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
18 #include "google_apis/google_api_keys.h" | 19 #include "google_apis/google_api_keys.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 85 } |
85 | 86 |
86 void NavigationCorrectionTabObserver::OnEnabledChanged() { | 87 void NavigationCorrectionTabObserver::OnEnabledChanged() { |
87 UpdateNavigationCorrectionInfo(web_contents()->GetRenderViewHost()); | 88 UpdateNavigationCorrectionInfo(web_contents()->GetRenderViewHost()); |
88 } | 89 } |
89 | 90 |
90 void NavigationCorrectionTabObserver::UpdateNavigationCorrectionInfo( | 91 void NavigationCorrectionTabObserver::UpdateNavigationCorrectionInfo( |
91 RenderViewHost* rvh) { | 92 RenderViewHost* rvh) { |
92 RenderFrameHost* rfh = rvh->GetMainFrame(); | 93 RenderFrameHost* rfh = rvh->GetMainFrame(); |
93 rfh->Send(new ChromeViewMsg_SetNavigationCorrectionInfo( | 94 rfh->Send(new ChromeViewMsg_SetNavigationCorrectionInfo( |
94 rfh->GetRoutingID(), GetNavigationCorrectionURL(), | 95 rfh->GetRoutingID(), |
| 96 GetNavigationCorrectionURL(), |
95 google_util::GetGoogleLocale(), | 97 google_util::GetGoogleLocale(), |
96 google_util::GetGoogleCountryCode(profile_), google_apis::GetAPIKey(), | 98 google_util::GetGoogleCountryCode( |
97 google_util::GetGoogleSearchURL(profile_))); | 99 google_profile_helper::GetGoogleHomePageURL(profile_)), |
| 100 google_apis::GetAPIKey(), |
| 101 google_util::GetGoogleSearchURL( |
| 102 google_profile_helper::GetGoogleHomePageURL(profile_)))); |
98 } | 103 } |
OLD | NEW |