Chromium Code Reviews| Index: chrome/browser/instant/instant_controller.cc |
| diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc |
| index ffbfc3e855cdebcca4f7ce391336118fa136bdee..d5d90c920930040d5b02cf54173a2921f71805c1 100644 |
| --- a/chrome/browser/instant/instant_controller.cc |
| +++ b/chrome/browser/instant/instant_controller.cc |
| @@ -175,14 +175,19 @@ bool InstantController::Update(TabContentsWrapper* tab_contents, |
| // trial to normal mode, with no intervening call to DestroyPreviewContents(). |
| // This would leave the loader in a weird state, which would manifest if the |
| // user pressed <Enter> without calling Update(). TODO(sreeram): Handle it. |
| - if (InstantFieldTrial::IsHiddenExperiment(tab_contents->profile())) { |
| - // For the HIDDEN field trial we process |user_text| at commit time, which |
| + if (InstantFieldTrial::IsSilentExperiment(tab_contents->profile())) { |
| + // For the SILENT field trial we process |user_text| at commit time, which |
| // means we're never really out of date. |
| is_out_of_date_ = false; |
| loader_->MaybeLoadInstantURL(tab_contents, template_url); |
| return true; |
| } |
| + // For the HIDDEN field trial, never send back suggestions to the omnibox. |
|
sky
2011/10/24 15:03:31
This is a bit obscure. How about moving this after
sreeram
2011/10/24 17:14:50
Done.
|
| + string16 ignore_suggested_text; |
| + if (InstantFieldTrial::IsHiddenExperiment(tab_contents->profile())) |
| + suggested_text = &ignore_suggested_text; |
| + |
| UpdateLoader(template_url, match.destination_url, match.transition, user_text, |
| verbatim, suggested_text); |
| @@ -236,9 +241,12 @@ bool InstantController::PrepareForCommit() { |
| if (is_out_of_date_ || !loader_.get()) |
| return false; |
| - // If we are not in the HIDDEN field trial, return the status of the preview. |
| - if (!InstantFieldTrial::IsHiddenExperiment(tab_contents_->profile())) |
| + // If we are not in the HIDDEN or SILENT field trials, return the status of |
| + // the preview. |
| + if (!InstantFieldTrial::IsHiddenExperiment(tab_contents_->profile()) && |
| + !InstantFieldTrial::IsSilentExperiment(tab_contents_->profile())) { |
| return IsCurrent(); |
| + } |
| TemplateURLService* model = TemplateURLServiceFactory::GetForProfile( |
| tab_contents_->profile()); |
| @@ -419,7 +427,10 @@ void InstantController::SetSuggestedTextFor( |
| InstantLoader* loader, |
| const string16& text, |
| InstantCompleteBehavior behavior) { |
| - delegate_->SetSuggestedText(text, behavior); |
| + if (!is_out_of_date_ && |
| + !InstantFieldTrial::IsHiddenExperiment(tab_contents_->profile())) { |
| + delegate_->SetSuggestedText(text, behavior); |
| + } |
| } |
| gfx::Rect InstantController::GetInstantBounds() { |
| @@ -463,8 +474,11 @@ void InstantController::UpdateIsDisplayable() { |
| bool displayable = |
| (!is_out_of_date_ && loader_.get() && loader_->ready() && |
| loader_->http_status_ok()); |
| - if (displayable == is_displayable_) |
| + if (displayable == is_displayable_ || |
| + (displayable && |
| + InstantFieldTrial::IsHiddenExperiment(tab_contents_->profile()))) { |
|
sky
2011/10/24 15:03:31
Make this part of setting displayable.
sreeram
2011/10/24 17:14:50
Done.
|
| return; |
| + } |
| is_displayable_ = displayable; |
| if (!is_displayable_) { |