Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/search/instant_controller.h" | 5 #include "chrome/browser/ui/search/instant_controller.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1241 } else if (IsContentsFrom(ntp(), contents)) { | 1241 } else if (IsContentsFrom(ntp(), contents)) { |
| 1242 ntp_->SetDisplayInstantResults(instant_enabled_); | 1242 ntp_->SetDisplayInstantResults(instant_enabled_); |
| 1243 ntp_->SetOmniboxBounds(omnibox_bounds_); | 1243 ntp_->SetOmniboxBounds(omnibox_bounds_); |
| 1244 ntp_->InitializeFonts(); | 1244 ntp_->InitializeFonts(); |
| 1245 } else { | 1245 } else { |
| 1246 NOTREACHED(); | 1246 NOTREACHED(); |
| 1247 } | 1247 } |
| 1248 UpdateMostVisitedItems(); | 1248 UpdateMostVisitedItems(); |
| 1249 } | 1249 } |
| 1250 | 1250 |
| 1251 void InstantController::InstantSupportChanged( | |
| 1252 const content::WebContents* contents, | |
|
samarth
2013/06/19 05:25:02
This parameter is no longer necessary.
kmadhusu
2013/06/19 16:28:15
Fixed.
| |
| 1253 InstantSupportState instant_support) { | |
| 1254 // Handle INSTANT_SUPPORT_YES here because InstantPage is not hooked up to the | |
| 1255 // active tab. Search model changed listener in InstantPage will handle other | |
| 1256 // cases. | |
| 1257 if (instant_support != INSTANT_SUPPORT_YES) | |
| 1258 return; | |
| 1259 | |
| 1260 ResetInstantTab(); | |
| 1261 } | |
| 1262 | |
| 1251 void InstantController::InstantSupportDetermined( | 1263 void InstantController::InstantSupportDetermined( |
| 1252 const content::WebContents* contents, | 1264 const content::WebContents* contents, |
| 1253 bool supports_instant) { | 1265 bool supports_instant) { |
| 1254 if (IsContentsFrom(instant_tab(), contents)) { | 1266 if (IsContentsFrom(instant_tab(), contents)) { |
| 1255 if (!supports_instant) | 1267 if (!supports_instant) |
| 1256 base::MessageLoop::current()->DeleteSoon(FROM_HERE, | 1268 base::MessageLoop::current()->DeleteSoon(FROM_HERE, |
| 1257 instant_tab_.release()); | 1269 instant_tab_.release()); |
| 1258 | 1270 |
| 1259 content::NotificationService::current()->Notify( | 1271 content::NotificationService::current()->Notify( |
| 1260 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED, | 1272 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED, |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1867 result->transition = match.transition; | 1879 result->transition = match.transition; |
| 1868 result->relevance = match.relevance; | 1880 result->relevance = match.relevance; |
| 1869 result->autocomplete_match_index = autocomplete_match_index; | 1881 result->autocomplete_match_index = autocomplete_match_index; |
| 1870 | 1882 |
| 1871 DVLOG(1) << " " << result->relevance << " " | 1883 DVLOG(1) << " " << result->relevance << " " |
| 1872 << UTF8ToUTF16(AutocompleteMatchType::ToString(result->type)) << " " | 1884 << UTF8ToUTF16(AutocompleteMatchType::ToString(result->type)) << " " |
| 1873 << result->provider << " " << result->destination_url << " '" | 1885 << result->provider << " " << result->destination_url << " '" |
| 1874 << result->description << "' '" << result->search_query << "' " | 1886 << result->description << "' '" << result->search_query << "' " |
| 1875 << result->transition << " " << result->autocomplete_match_index; | 1887 << result->transition << " " << result->autocomplete_match_index; |
| 1876 } | 1888 } |
| OLD | NEW |