diff options
Diffstat (limited to 'chrome/browser/ui/browser_instant_controller.cc')
-rw-r--r-- | chrome/browser/ui/browser_instant_controller.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc index b9ae096..9b82049 100644 --- a/chrome/browser/ui/browser_instant_controller.cc +++ b/chrome/browser/ui/browser_instant_controller.cc @@ -12,6 +12,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/omnibox/location_bar.h" +#include "chrome/browser/ui/omnibox/omnibox_view.h" #include "chrome/browser/ui/search/search.h" #include "chrome/browser/ui/search/search_tab_helper.h" #include "chrome/browser/ui/tab_contents/tab_contents.h" @@ -112,8 +113,7 @@ void BrowserInstantController::CommitInstant(content::WebContents* preview, void BrowserInstantController::SetInstantSuggestion( const InstantSuggestion& suggestion) { - if (browser_->window()->GetLocationBar()) - browser_->window()->GetLocationBar()->SetInstantSuggestion(suggestion); + browser_->window()->GetLocationBar()->SetInstantSuggestion(suggestion); } gfx::Rect BrowserInstantController::GetInstantBounds() { @@ -125,6 +125,13 @@ void BrowserInstantController::InstantPreviewFocused() { browser_->window()->WebContentsFocused(instant_.GetPreviewContents()); } +void BrowserInstantController::FocusOmniboxInvisibly() { + OmniboxView* omnibox_view = browser_->window()->GetLocationBar()-> + GetLocationEntry(); + omnibox_view->SetFocus(); + omnibox_view->model()->SetCaretVisibility(false); +} + content::WebContents* BrowserInstantController::GetActiveWebContents() const { return browser_->tab_strip_model()->GetActiveWebContents(); } |