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

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: 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
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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 // Then check if the text before the inserted space matches a keyword. 1109 // Then check if the text before the inserted space matches a keyword.
1110 string16 keyword; 1110 string16 keyword;
1111 TrimWhitespace(new_text.substr(0, space_position), TRIM_LEADING, &keyword); 1111 TrimWhitespace(new_text.substr(0, space_position), TRIM_LEADING, &keyword);
1112 return !keyword.empty() && 1112 return !keyword.empty() &&
1113 !autocomplete_controller_->keyword_provider()-> 1113 !autocomplete_controller_->keyword_provider()->
1114 GetKeywordForText(keyword).empty(); 1114 GetKeywordForText(keyword).empty();
1115 } 1115 }
1116 1116
1117 void OmniboxEditModel::NotifySearchTabHelper() { 1117 void OmniboxEditModel::NotifySearchTabHelper() {
1118 if (controller_->GetTabContents()) { 1118 if (controller_->GetTabContents()) {
1119 controller_->GetTabContents()->search_tab_helper()-> 1119 chrome::search::SearchTabHelper::FromWebContents(
1120 OmniboxEditModelChanged(user_input_in_progress_, !in_revert_); 1120 controller_->GetTabContents()->web_contents())->
1121 OmniboxEditModelChanged(user_input_in_progress_, !in_revert_);
1121 } 1122 }
1122 } 1123 }
1123 1124
1124 bool OmniboxEditModel::DoInstant(const AutocompleteMatch& match) { 1125 bool OmniboxEditModel::DoInstant(const AutocompleteMatch& match) {
1125 if (in_revert_) 1126 if (in_revert_)
1126 return false; 1127 return false;
1127 1128
1128 InstantController* instant = controller_->GetInstant(); 1129 InstantController* instant = controller_->GetInstant();
1129 1130
1130 if (!instant) 1131 if (!instant)
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 } 1225 }
1225 1226
1226 void OmniboxEditModel::ClassifyStringForPasteAndGo( 1227 void OmniboxEditModel::ClassifyStringForPasteAndGo(
1227 const string16& text, 1228 const string16& text,
1228 AutocompleteMatch* match, 1229 AutocompleteMatch* match,
1229 GURL* alternate_nav_url) const { 1230 GURL* alternate_nav_url) const {
1230 DCHECK(match); 1231 DCHECK(match);
1231 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, 1232 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text,
1232 string16(), false, false, match, alternate_nav_url); 1233 string16(), false, false, match, alternate_nav_url);
1233 } 1234 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698