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

Side by Side Diff: chrome/browser/instant/instant_controller.cc

Issue 11418092: InstantExtended: Rely on the page to call Show(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/instant/instant_controller.h" 5 #include "chrome/browser/instant/instant_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 last_suggestion_ = suggestion; 636 last_suggestion_ = suggestion;
637 637
638 if (!suggestion.text.empty()) { 638 if (!suggestion.text.empty()) {
639 DVLOG(1) << "SetInstantSuggestion: text='" << suggestion.text << "'" 639 DVLOG(1) << "SetInstantSuggestion: text='" << suggestion.text << "'"
640 << " behavior=" << suggestion.behavior << " type=" 640 << " behavior=" << suggestion.behavior << " type="
641 << suggestion.type; 641 << suggestion.type;
642 browser_->SetInstantSuggestion(suggestion); 642 browser_->SetInstantSuggestion(suggestion);
643 } 643 }
644 } 644 }
645 645
646 Show(INSTANT_SHOWN_QUERY_SUGGESTIONS, 100, INSTANT_SIZE_PERCENT); 646 // Extended mode pages will show() when ready.
647 if (!extended_enabled_)
648 Show(INSTANT_SHOWN_QUERY_SUGGESTIONS, 100, INSTANT_SIZE_PERCENT);
647 } 649 }
648 650
649 void InstantController::CommitInstantLoader(InstantLoader* loader) { 651 void InstantController::CommitInstantLoader(InstantLoader* loader) {
650 if (loader_ == loader) 652 if (loader_ == loader)
651 CommitIfCurrent(INSTANT_COMMIT_FOCUS_LOST); 653 CommitIfCurrent(INSTANT_COMMIT_FOCUS_LOST);
652 } 654 }
653 655
654 void InstantController::ShowInstantPreview(InstantLoader* loader, 656 void InstantController::ShowInstantPreview(InstantLoader* loader,
655 InstantShownReason reason, 657 InstantShownReason reason,
656 int height, 658 int height,
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 } 903 }
902 904
903 std::map<std::string, int>::const_iterator iter = 905 std::map<std::string, int>::const_iterator iter =
904 blacklisted_urls_.find(*instant_url); 906 blacklisted_urls_.find(*instant_url);
905 if (iter != blacklisted_urls_.end() && 907 if (iter != blacklisted_urls_.end() &&
906 iter->second > kMaxInstantSupportFailures) 908 iter->second > kMaxInstantSupportFailures)
907 return false; 909 return false;
908 910
909 return true; 911 return true;
910 } 912 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698