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

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

Issue 8253002: Move PageTransition into content namespace. While I'm touching all these files, I've also updated... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 matches_.end(), &AutocompleteMatch::MoreRelevant); 654 matches_.end(), &AutocompleteMatch::MoreRelevant);
655 matches_.resize(num_matches); 655 matches_.resize(num_matches);
656 656
657 default_match_ = begin(); 657 default_match_ = begin();
658 658
659 // Set the alternate nav URL. 659 // Set the alternate nav URL.
660 alternate_nav_url_ = GURL(); 660 alternate_nav_url_ = GURL();
661 if (((input.type() == AutocompleteInput::UNKNOWN) || 661 if (((input.type() == AutocompleteInput::UNKNOWN) ||
662 (input.type() == AutocompleteInput::REQUESTED_URL)) && 662 (input.type() == AutocompleteInput::REQUESTED_URL)) &&
663 (default_match_ != end()) && 663 (default_match_ != end()) &&
664 (default_match_->transition != PageTransition::TYPED) && 664 (default_match_->transition != content::PAGE_TRANSITION_TYPED) &&
665 (default_match_->transition != PageTransition::KEYWORD) && 665 (default_match_->transition != content::PAGE_TRANSITION_KEYWORD) &&
666 (input.canonicalized_url() != default_match_->destination_url)) 666 (input.canonicalized_url() != default_match_->destination_url))
667 alternate_nav_url_ = input.canonicalized_url(); 667 alternate_nav_url_ = input.canonicalized_url();
668 } 668 }
669 669
670 bool AutocompleteResult::HasCopiedMatches() const { 670 bool AutocompleteResult::HasCopiedMatches() const {
671 for (ACMatches::const_iterator i = begin(); i != end(); ++i) { 671 for (ACMatches::const_iterator i = begin(); i != end(); ++i) {
672 if (i->from_previous) 672 if (i->from_previous)
673 return true; 673 return true;
674 } 674 }
675 return false; 675 return false;
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 } 1014 }
1015 done_ = true; 1015 done_ = true;
1016 } 1016 }
1017 1017
1018 void AutocompleteController::StartExpireTimer() { 1018 void AutocompleteController::StartExpireTimer() {
1019 if (result_.HasCopiedMatches()) 1019 if (result_.HasCopiedMatches())
1020 expire_timer_.Start(FROM_HERE, 1020 expire_timer_.Start(FROM_HERE,
1021 base::TimeDelta::FromMilliseconds(kExpireTimeMS), 1021 base::TimeDelta::FromMilliseconds(kExpireTimeMS),
1022 this, &AutocompleteController::ExpireCopiedEntries); 1022 this, &AutocompleteController::ExpireCopiedEntries);
1023 } 1023 }
OLDNEW
« no previous file with comments | « chrome/browser/alternate_nav_url_fetcher.cc ('k') | chrome/browser/autocomplete/autocomplete_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698