diff options
Diffstat (limited to 'chrome/browser/search_versus_navigate_classifier.cc')
-rw-r--r-- | chrome/browser/search_versus_navigate_classifier.cc | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/chrome/browser/search_versus_navigate_classifier.cc b/chrome/browser/search_versus_navigate_classifier.cc deleted file mode 100644 index b32b92b..0000000 --- a/chrome/browser/search_versus_navigate_classifier.cc +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/search_versus_navigate_classifier.h" - -#include "chrome/browser/autocomplete/autocomplete.h" -#include "googleurl/src/gurl.h" - -SearchVersusNavigateClassifier::SearchVersusNavigateClassifier(Profile* profile) - : controller_(new AutocompleteController(profile)) { -} - -SearchVersusNavigateClassifier::~SearchVersusNavigateClassifier() { -} - -void SearchVersusNavigateClassifier::Classify(const std::wstring& text, - const std::wstring& desired_tld, - bool* is_search, - GURL* destination_url, - PageTransition::Type* transition, - bool* is_history_what_you_typed_match, - GURL* alternate_nav_url) { - controller_->Start(text, desired_tld, true, false, true); - DCHECK(controller_->done()); - const AutocompleteResult& result = controller_->result(); - if (result.empty()) { - if (is_search) - *is_search = false; - if (destination_url) - *destination_url = GURL(); - if (transition) - *transition = PageTransition::TYPED; - if (is_history_what_you_typed_match) - *is_history_what_you_typed_match = false; - if (alternate_nav_url) - *alternate_nav_url = GURL(); - return; - } - - const AutocompleteResult::const_iterator match(result.default_match()); - DCHECK(match != result.end()); - - // If this is a search, the page transition will be GENERATED rather than - // TYPED. - if (is_search) - *is_search = (match->transition != PageTransition::TYPED); - if (destination_url) - *destination_url = match->destination_url; - if (transition) - *transition = match->transition; - if (is_history_what_you_typed_match) - *is_history_what_you_typed_match = match->is_history_what_you_typed_match; - if (alternate_nav_url) - *alternate_nav_url = result.alternate_nav_url(); -} |