Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Side by Side Diff: chrome/browser/ui/search/instant_controller.cc

Issue 16035020: Move instant support to SearchTabHelper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing unit_test Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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,
1253 InstantSupportState instant_support) {
1254 if (instant_support == INSTANT_SUPPORT_UNKNOWN)
samarth 2013/06/18 22:03:36 I don't think this is right either because now we
kmadhusu 2013/06/18 23:22:56 Done.
1255 return;
1256
1257 InstantSupportDetermined(contents, instant_support == INSTANT_SUPPORT_YES);
1258 }
1259
1251 void InstantController::InstantSupportDetermined( 1260 void InstantController::InstantSupportDetermined(
1252 const content::WebContents* contents, 1261 const content::WebContents* contents,
1253 bool supports_instant) { 1262 bool supports_instant) {
1254 if (IsContentsFrom(instant_tab(), contents)) { 1263 if (IsContentsFrom(instant_tab(), contents)) {
1255 if (!supports_instant) 1264 if (!supports_instant)
1256 base::MessageLoop::current()->DeleteSoon(FROM_HERE, 1265 base::MessageLoop::current()->DeleteSoon(FROM_HERE,
1257 instant_tab_.release()); 1266 instant_tab_.release());
1258 1267
1259 content::NotificationService::current()->Notify( 1268 content::NotificationService::current()->Notify(
1260 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED, 1269 chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED,
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1867 result->transition = match.transition; 1876 result->transition = match.transition;
1868 result->relevance = match.relevance; 1877 result->relevance = match.relevance;
1869 result->autocomplete_match_index = autocomplete_match_index; 1878 result->autocomplete_match_index = autocomplete_match_index;
1870 1879
1871 DVLOG(1) << " " << result->relevance << " " 1880 DVLOG(1) << " " << result->relevance << " "
1872 << UTF8ToUTF16(AutocompleteMatchType::ToString(result->type)) << " " 1881 << UTF8ToUTF16(AutocompleteMatchType::ToString(result->type)) << " "
1873 << result->provider << " " << result->destination_url << " '" 1882 << result->provider << " " << result->destination_url << " '"
1874 << result->description << "' '" << result->search_query << "' " 1883 << result->description << "' '" << result->search_query << "' "
1875 << result->transition << " " << result->autocomplete_match_index; 1884 << result->transition << " " << result->autocomplete_match_index;
1876 } 1885 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_controller.h ('k') | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698