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

Unified Diff: chrome/browser/ui/search/instant_controller.cc

Issue 525793002: Make WebContentsObserver::web_contents() public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 4 months 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
Index: chrome/browser/ui/search/instant_controller.cc
diff --git a/chrome/browser/ui/search/instant_controller.cc b/chrome/browser/ui/search/instant_controller.cc
index 0021a5f7e5a728567eb6a9cd607f316ad5e89633..1d78ce7c46c127d60799da7f499cb1f71517a2bc 100644
--- a/chrome/browser/ui/search/instant_controller.cc
+++ b/chrome/browser/ui/search/instant_controller.cc
@@ -42,7 +42,7 @@ namespace {
bool IsContentsFrom(const InstantPage* page,
const content::WebContents* contents) {
- return page && (page->contents() == contents);
+ return page && (page->web_contents() == contents);
}
// Adds a transient NavigationEntry to the supplied |contents|'s
@@ -87,10 +87,10 @@ bool InstantController::SubmitQuery(const base::string16& search_terms) {
search_mode_.is_origin_search()) {
// Use |instant_tab_| to run the query if we're already on a search results
// page. (NOTE: in particular, we do not send the query to NTPs.)
- SearchTabHelper::FromWebContents(instant_tab_->contents())->Submit(
- search_terms);
- instant_tab_->contents()->Focus();
- EnsureSearchTermsAreSet(instant_tab_->contents(), search_terms);
+ SearchTabHelper::FromWebContents(instant_tab_->web_contents())
+ ->Submit(search_terms);
Peter Kasting 2014/09/02 19:37:06 Nit: Don't change wrapping here
lucinka.brozkova 2014/09/03 08:16:24 Done.
+ instant_tab_->web_contents()->Focus();
+ EnsureSearchTermsAreSet(instant_tab_->web_contents(), search_terms);
return true;
}
return false;
@@ -178,7 +178,7 @@ void InstantController::InstantPageAboutToNavigateMainFrame(
void InstantController::ResetInstantTab() {
if (!search_mode_.is_origin_default()) {
content::WebContents* active_tab = browser_->GetActiveWebContents();
- if (!instant_tab_ || active_tab != instant_tab_->contents()) {
+ if (!instant_tab_ || active_tab != instant_tab_->web_contents()) {
instant_tab_.reset(new InstantTab(this, browser_->profile()));
instant_tab_->Init(active_tab);
UpdateInfoForInstantTab();

Powered by Google App Engine
This is Rietveld 408576698