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

Side by Side Diff: chrome/browser/autocomplete/autocomplete.cc

Issue 7822009: Fix crash in CanFindIntranetURL() due to FixupUserInput() changing the AutocompleteInput's text_ ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/autocomplete/autocomplete.h" 5 #include "chrome/browser/autocomplete/autocomplete.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 if (!net::CanStripTrailingSlash(url)) 449 if (!net::CanStripTrailingSlash(url))
450 return formatted_url; 450 return formatted_url;
451 const string16 url_with_path(formatted_url + char16('/')); 451 const string16 url_with_path(formatted_url + char16('/'));
452 return (AutocompleteInput::Parse(formatted_url, string16(), NULL, NULL, 452 return (AutocompleteInput::Parse(formatted_url, string16(), NULL, NULL,
453 NULL) == 453 NULL) ==
454 AutocompleteInput::Parse(url_with_path, string16(), NULL, NULL, 454 AutocompleteInput::Parse(url_with_path, string16(), NULL, NULL,
455 NULL)) ? 455 NULL)) ?
456 formatted_url : url_with_path; 456 formatted_url : url_with_path;
457 } 457 }
458 458
459 void AutocompleteInput::UpdateText(const string16& text,
460 const url_parse::Parsed& parts) {
461 text_ = text;
462 parts_ = parts;
463 }
459 464
460 bool AutocompleteInput::Equals(const AutocompleteInput& other) const { 465 bool AutocompleteInput::Equals(const AutocompleteInput& other) const {
461 return (text_ == other.text_) && 466 return (text_ == other.text_) &&
462 (type_ == other.type_) && 467 (type_ == other.type_) &&
463 (desired_tld_ == other.desired_tld_) && 468 (desired_tld_ == other.desired_tld_) &&
464 (scheme_ == other.scheme_) && 469 (scheme_ == other.scheme_) &&
465 (prevent_inline_autocomplete_ == other.prevent_inline_autocomplete_) && 470 (prevent_inline_autocomplete_ == other.prevent_inline_autocomplete_) &&
466 (prefer_keyword_ == other.prefer_keyword_) && 471 (prefer_keyword_ == other.prefer_keyword_) &&
467 (matches_requested_ == other.matches_requested_); 472 (matches_requested_ == other.matches_requested_);
468 } 473 }
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 } 1014 }
1010 } 1015 }
1011 done_ = true; 1016 done_ = true;
1012 } 1017 }
1013 1018
1014 void AutocompleteController::StartExpireTimer() { 1019 void AutocompleteController::StartExpireTimer() {
1015 if (result_.HasCopiedMatches()) 1020 if (result_.HasCopiedMatches())
1016 expire_timer_.Start(base::TimeDelta::FromMilliseconds(kExpireTimeMS), 1021 expire_timer_.Start(base::TimeDelta::FromMilliseconds(kExpireTimeMS),
1017 this, &AutocompleteController::ExpireCopiedEntries); 1022 this, &AutocompleteController::ExpireCopiedEntries);
1018 } 1023 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.h ('k') | chrome/browser/autocomplete/history_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698