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

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

Issue 23621037: Send URLs on non-zero prefix suggest requests also. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use domain matching between search provider for HTTPS pages Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 if (!match.destination_url.is_valid()) { 252 if (!match.destination_url.is_valid()) {
253 GetInfoForCurrentText(&match, alternate_nav_url); 253 GetInfoForCurrentText(&match, alternate_nav_url);
254 } else if (alternate_nav_url) { 254 } else if (alternate_nav_url) {
255 *alternate_nav_url = AutocompleteResult::ComputeAlternateNavUrl( 255 *alternate_nav_url = AutocompleteResult::ComputeAlternateNavUrl(
256 autocomplete_controller()->input(), match); 256 autocomplete_controller()->input(), match);
257 } 257 }
258 return match; 258 return match;
259 } 259 }
260 260
261 bool OmniboxEditModel::UpdatePermanentText() { 261 bool OmniboxEditModel::UpdatePermanentText() {
262 SearchProvider* search_provider =
263 autocomplete_controller()->search_provider();
264 if (search_provider)
265 search_provider->set_current_page_url(delegate_->GetURL());
266
262 // When there's new permanent text, and the user isn't interacting with the 267 // When there's new permanent text, and the user isn't interacting with the
263 // omnibox, we want to revert the edit to show the new text. We could simply 268 // omnibox, we want to revert the edit to show the new text. We could simply
264 // define "interacting" as "the omnibox has focus", but we still allow updates 269 // define "interacting" as "the omnibox has focus", but we still allow updates
265 // when the omnibox has focus as long as the user hasn't begun editing, isn't 270 // when the omnibox has focus as long as the user hasn't begun editing, isn't
266 // seeing zerosuggestions (because changing this text would require changing 271 // seeing zerosuggestions (because changing this text would require changing
267 // or hiding those suggestions), and hasn't toggled on "Show URL" (because 272 // or hiding those suggestions), and hasn't toggled on "Show URL" (because
268 // this update will re-enable search term replacement, which will be annoying 273 // this update will re-enable search term replacement, which will be annoying
269 // if the user is trying to copy the URL). When the omnibox doesn't have 274 // if the user is trying to copy the URL). When the omnibox doesn't have
270 // focus, we assume the user may have abandoned their interaction and it's 275 // focus, we assume the user may have abandoned their interaction and it's
271 // always safe to change the text; this also prevents someone toggling "Show 276 // always safe to change the text; this also prevents someone toggling "Show
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 instant->OmniboxFocusChanged(state, reason, NULL); 1390 instant->OmniboxFocusChanged(state, reason, NULL);
1386 1391
1387 // Update state and notify view if the omnibox has focus and the caret 1392 // Update state and notify view if the omnibox has focus and the caret
1388 // visibility changed. 1393 // visibility changed.
1389 const bool was_caret_visible = is_caret_visible(); 1394 const bool was_caret_visible = is_caret_visible();
1390 focus_state_ = state; 1395 focus_state_ = state;
1391 if (focus_state_ != OMNIBOX_FOCUS_NONE && 1396 if (focus_state_ != OMNIBOX_FOCUS_NONE &&
1392 is_caret_visible() != was_caret_visible) 1397 is_caret_visible() != was_caret_visible)
1393 view_->ApplyCaretVisibility(); 1398 view_->ApplyCaretVisibility();
1394 } 1399 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698