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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 10944016: Switch SearchTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/search/search_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" 5 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 // Then check if the text before the inserted space matches a keyword. 1145 // Then check if the text before the inserted space matches a keyword.
1146 string16 keyword; 1146 string16 keyword;
1147 TrimWhitespace(new_text.substr(0, space_position), TRIM_LEADING, &keyword); 1147 TrimWhitespace(new_text.substr(0, space_position), TRIM_LEADING, &keyword);
1148 return !keyword.empty() && 1148 return !keyword.empty() &&
1149 !autocomplete_controller_->keyword_provider()-> 1149 !autocomplete_controller_->keyword_provider()->
1150 GetKeywordForText(keyword).empty(); 1150 GetKeywordForText(keyword).empty();
1151 } 1151 }
1152 1152
1153 void OmniboxEditModel::NotifySearchTabHelper() { 1153 void OmniboxEditModel::NotifySearchTabHelper() {
1154 if (controller_->GetTabContents()) { 1154 if (controller_->GetTabContents()) {
1155 controller_->GetTabContents()->search_tab_helper()-> 1155 chrome::search::SearchTabHelper::FromWebContents(
1156 OmniboxEditModelChanged(user_input_in_progress_, !in_revert_); 1156 controller_->GetTabContents()->web_contents())->
1157 OmniboxEditModelChanged(user_input_in_progress_, !in_revert_);
1157 } 1158 }
1158 } 1159 }
1159 1160
1160 bool OmniboxEditModel::DoInstant(const AutocompleteMatch& match) { 1161 bool OmniboxEditModel::DoInstant(const AutocompleteMatch& match) {
1161 if (in_revert_) 1162 if (in_revert_)
1162 return false; 1163 return false;
1163 1164
1164 InstantController* instant = controller_->GetInstant(); 1165 InstantController* instant = controller_->GetInstant();
1165 1166
1166 if (!instant) 1167 if (!instant)
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 } 1261 }
1261 1262
1262 void OmniboxEditModel::ClassifyStringForPasteAndGo( 1263 void OmniboxEditModel::ClassifyStringForPasteAndGo(
1263 const string16& text, 1264 const string16& text,
1264 AutocompleteMatch* match, 1265 AutocompleteMatch* match,
1265 GURL* alternate_nav_url) const { 1266 GURL* alternate_nav_url) const {
1266 DCHECK(match); 1267 DCHECK(match);
1267 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, 1268 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text,
1268 string16(), false, false, match, alternate_nav_url); 1269 string16(), false, false, match, alternate_nav_url);
1269 } 1270 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/search/search_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698