| Index: chrome/browser/instant/instant_controller.cc
|
| diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
|
| index 869c0293123248bbdc986880c17051b1d6508f90..c9a94d7232bf78472a5f9ec53a3e884b8f4c073e 100644
|
| --- a/chrome/browser/instant/instant_controller.cc
|
| +++ b/chrome/browser/instant/instant_controller.cc
|
| @@ -222,7 +222,7 @@ bool InstantController::Update(const AutocompleteMatch& match,
|
| // still Q, so we don't Update() the loader, but we do need to Show().
|
| if (loader_processed_last_update_ &&
|
| (mode_ == INSTANT || mode_ == EXTENDED))
|
| - Show();
|
| + Show(100, INSTANT_SIZE_PERCENT);
|
| return true;
|
| }
|
|
|
| @@ -297,6 +297,11 @@ void InstantController::Hide() {
|
| if (is_showing_) {
|
| is_showing_ = false;
|
| delegate_->HideInstant();
|
| +
|
| + content::NotificationService::current()->Notify(
|
| + chrome::NOTIFICATION_INSTANT_CONTROLLER_HIDDEN,
|
| + content::Source<InstantController>(this),
|
| + content::NotificationService::NoDetails());
|
| }
|
| if (GetPreviewContents() && !last_full_text_.empty()) {
|
| // Send a blank query to ask the preview to clear out old results.
|
| @@ -495,7 +500,7 @@ void InstantController::SetSuggestions(
|
| delegate_->SetSuggestedText(suggestion.text, suggestion.behavior);
|
|
|
| if (mode_ != SUGGEST)
|
| - Show();
|
| + Show(100, INSTANT_SIZE_PERCENT);
|
| }
|
|
|
| void InstantController::CommitInstantLoader(InstantLoader* loader) {
|
| @@ -507,6 +512,16 @@ void InstantController::CommitInstantLoader(InstantLoader* loader) {
|
| CommitCurrentPreview(INSTANT_COMMIT_FOCUS_LOST);
|
| }
|
|
|
| +void InstantController::SetInstantPreviewHeight(InstantLoader* loader,
|
| + int height,
|
| + InstantSizeUnits units) {
|
| + DCHECK_EQ(loader_.get(), loader);
|
| + if (loader_ != loader || mode_ != EXTENDED)
|
| + return;
|
| +
|
| + Show(height, units);
|
| +}
|
| +
|
| void InstantController::InstantLoaderPreviewLoaded(InstantLoader* loader) {
|
| DCHECK_EQ(loader_.get(), loader);
|
| AddPreviewUsageForHistogram(mode_, PREVIEW_LOADED);
|
| @@ -539,7 +554,7 @@ void InstantController::InstantSupportDetermined(InstantLoader* loader,
|
| void InstantController::SwappedTabContents(InstantLoader* loader) {
|
| DCHECK_EQ(loader_.get(), loader);
|
| if (loader_ == loader && is_showing_)
|
| - delegate_->ShowInstant();
|
| + delegate_->ShowInstant(100, INSTANT_SIZE_PERCENT);
|
| }
|
|
|
| void InstantController::InstantLoaderContentsFocused(InstantLoader* loader) {
|
| @@ -633,11 +648,17 @@ void InstantController::DeleteLoader() {
|
| loader_.reset();
|
| }
|
|
|
| -void InstantController::Show() {
|
| +void InstantController::Show(int height, InstantSizeUnits units) {
|
| + // Call even if showing in case height changed.
|
| + delegate_->ShowInstant(height, units);
|
| if (!is_showing_) {
|
| is_showing_ = true;
|
| - delegate_->ShowInstant();
|
| AddPreviewUsageForHistogram(mode_, PREVIEW_SHOWED);
|
| +
|
| + content::NotificationService::current()->Notify(
|
| + chrome::NOTIFICATION_INSTANT_CONTROLLER_SHOWN,
|
| + content::Source<InstantController>(this),
|
| + content::NotificationService::NoDetails());
|
| }
|
| }
|
|
|
|
|