Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
|
samarth
2013/06/19 05:39:20
Why any changes to this file at all?
jeremycho
2013/06/19 07:16:48
I figured this change would be needed eventually t
samarth
2013/06/19 16:40:23
No, by going through SearchTabHelper, now Peter's
jeremycho
2013/06/19 20:11:34
I see. Reverted changes.
| |
| 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" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| (...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1412 } else { | 1412 } else { |
| 1413 last_suggestion_ = InstantSuggestion(); | 1413 last_suggestion_ = InstantSuggestion(); |
| 1414 } | 1414 } |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 // Extended mode pages will call ShowOverlay() when they are ready. | 1417 // Extended mode pages will call ShowOverlay() when they are ready. |
| 1418 if (!extended_enabled()) | 1418 if (!extended_enabled()) |
| 1419 ShowOverlay(100, INSTANT_SIZE_PERCENT); | 1419 ShowOverlay(100, INSTANT_SIZE_PERCENT); |
| 1420 } | 1420 } |
| 1421 | 1421 |
| 1422 void InstantController::SetVoiceSearchSupported( | |
| 1423 const content::WebContents* contents, bool supported) { | |
| 1424 if (!extended_enabled()) | |
| 1425 return; | |
| 1426 // TODO(pkasting): Implement this function. | |
| 1427 } | |
| 1428 | |
| 1422 void InstantController::ShowInstantOverlay(const content::WebContents* contents, | 1429 void InstantController::ShowInstantOverlay(const content::WebContents* contents, |
| 1423 int height, | 1430 int height, |
| 1424 InstantSizeUnits units) { | 1431 InstantSizeUnits units) { |
| 1425 if (extended_enabled() && IsContentsFrom(overlay(), contents)) | 1432 if (extended_enabled() && IsContentsFrom(overlay(), contents)) |
| 1426 ShowOverlay(height, units); | 1433 ShowOverlay(height, units); |
| 1427 } | 1434 } |
| 1428 | 1435 |
| 1429 void InstantController::LogDropdownShown() { | 1436 void InstantController::LogDropdownShown() { |
| 1430 // If suggestions are being shown for the first time since the user started | 1437 // If suggestions are being shown for the first time since the user started |
| 1431 // typing, record a histogram value. | 1438 // typing, record a histogram value. |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1867 result->transition = match.transition; | 1874 result->transition = match.transition; |
| 1868 result->relevance = match.relevance; | 1875 result->relevance = match.relevance; |
| 1869 result->autocomplete_match_index = autocomplete_match_index; | 1876 result->autocomplete_match_index = autocomplete_match_index; |
| 1870 | 1877 |
| 1871 DVLOG(1) << " " << result->relevance << " " | 1878 DVLOG(1) << " " << result->relevance << " " |
| 1872 << UTF8ToUTF16(AutocompleteMatchType::ToString(result->type)) << " " | 1879 << UTF8ToUTF16(AutocompleteMatchType::ToString(result->type)) << " " |
| 1873 << result->provider << " " << result->destination_url << " '" | 1880 << result->provider << " " << result->destination_url << " '" |
| 1874 << result->description << "' '" << result->search_query << "' " | 1881 << result->description << "' '" << result->search_query << "' " |
| 1875 << result->transition << " " << result->autocomplete_match_index; | 1882 << result->transition << " " << result->autocomplete_match_index; |
| 1876 } | 1883 } |
| OLD | NEW |