Skip to content

Commit

Permalink
Fix two bugs caused by scheme stripping:
Browse files Browse the repository at this point in the history
* We no longer detected that the user was dragging the permanent_text_, and thus that we could give the drag a title and favicon.
* We no longer scored hitting enter on the URL as a RELOAD.

BUG=47555
TEST=Visit www.google.com.  Drag the omnibox text to the desktop.  The shortcut should have a title and favicon.
Review URL: http://codereview.chromium.org/3030039

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54694 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pkasting@chromium.org committed Aug 3, 2010
1 parent c33f6a6 commit 7f2a9db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chrome/browser/autocomplete/autocomplete_edit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ void AutocompleteEditModel::GetDataForURLExport(GURL* url,
AutocompleteMatch match;
GetInfoForCurrentText(&match, NULL);
*url = match.destination_url;
if (UTF8ToWide(url->possibly_invalid_spec()) == permanent_text_) {
if (*url == URLFixerUpper::FixupURL(WideToUTF8(permanent_text_),
std::string())) {
*title = controller_->GetTitle();
*favicon = controller_->GetFavIcon();
}
Expand Down Expand Up @@ -297,7 +298,8 @@ void AutocompleteEditModel::AcceptInput(WindowOpenDisposition disposition,
if (!match.destination_url.is_valid())
return;

if (UTF8ToWide(match.destination_url.spec()) == permanent_text_) {
if (match.destination_url ==
URLFixerUpper::FixupURL(WideToUTF8(permanent_text_), std::string())) {
// When the user hit enter on the existing permanent URL, treat it like a
// reload for scoring purposes. We could detect this by just checking
// user_input_in_progress_, but it seems better to treat "edits" that end
Expand Down

0 comments on commit 7f2a9db

Please sign in to comment.