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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit.cc

Issue 8772041: Remove deprecated TabContentsDelegate::OpenURLFromTab variant (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base.gypi ('k') | chrome/browser/automation/automation_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit.cc
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc
index 6c971b8243805dcc17ac28307c5952d3da988527..ce015310d0767ba65ed206be674e90844f80f3fb 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc
@@ -1028,25 +1028,32 @@ bool AutocompleteEditModel::DoInstant(const AutocompleteMatch& match,
if (!instant)
return false;
+ // It's possible the tab strip does not have an active tab contents, for
+ // instance if the tab has been closed or on return from a sleep state
+ // (http://crbug.com/105689)
TabContentsWrapper* tab = controller_->GetTabContentsWrapper();
-
if (!tab)
return false;
if (user_input_in_progress() && popup_->IsOpen()) {
return instant->Update(tab, match, view_->GetText(), UseVerbatimInstant(),
suggested_text);
- } else {
- instant->Hide();
- return false;
}
+
+ instant->Hide();
+ return false;
}
void AutocompleteEditModel::DoPrerender(const AutocompleteMatch& match) {
// Do not prerender if the destination URL is the same as the current URL.
if (match.destination_url == PermanentURL())
return;
+ // It's possible the tab strip does not have an active tab contents, for
+ // instance if the tab has been closed or on return from a sleep state
+ // (http://crbug.com/105689)
TabContentsWrapper* tab = controller_->GetTabContentsWrapper();
+ if (!tab)
+ return;
prerender::PrerenderManager* prerender_manager =
prerender::PrerenderManagerFactory::GetForProfile(tab->profile());
if (prerender_manager) {
« no previous file with comments | « base/base.gypi ('k') | chrome/browser/automation/automation_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698