| OLD | NEW | 
|     1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |     1 // Copyright (c) 2010 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 "app/l10n_util.h" |     9 #include "app/l10n_util.h" | 
|    10 #include "base/basictypes.h" |    10 #include "base/basictypes.h" | 
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   410     "search-other-engine", |   410     "search-other-engine", | 
|   411     "open-history-page", |   411     "open-history-page", | 
|   412   }; |   412   }; | 
|   413   DCHECK(arraysize(strings) == NUM_TYPES); |   413   DCHECK(arraysize(strings) == NUM_TYPES); | 
|   414   return strings[type]; |   414   return strings[type]; | 
|   415 } |   415 } | 
|   416  |   416  | 
|   417 // static |   417 // static | 
|   418 int AutocompleteMatch::TypeToIcon(Type type) { |   418 int AutocompleteMatch::TypeToIcon(Type type) { | 
|   419   int icons[NUM_TYPES] = { |   419   int icons[NUM_TYPES] = { | 
|   420     IDR_O2_GLOBE, |   420     IDR_OMNIBOX_HTTP, | 
|   421     IDR_O2_GLOBE, |   421     IDR_OMNIBOX_HTTP, | 
|   422     IDR_O2_HISTORY, |   422     IDR_OMNIBOX_HISTORY, | 
|   423     IDR_O2_HISTORY, |   423     IDR_OMNIBOX_HISTORY, | 
|   424     IDR_O2_HISTORY, |   424     IDR_OMNIBOX_HISTORY, | 
|   425     IDR_O2_GLOBE, |   425     IDR_OMNIBOX_HTTP, | 
|   426     IDR_O2_SEARCH, |   426     IDR_OMNIBOX_SEARCH, | 
|   427     IDR_O2_SEARCH, |   427     IDR_OMNIBOX_SEARCH, | 
|   428     IDR_O2_SEARCH, |   428     IDR_OMNIBOX_SEARCH, | 
|   429     IDR_O2_SEARCH, |   429     IDR_OMNIBOX_SEARCH, | 
|   430     IDR_O2_MORE, |   430     IDR_OMNIBOX_MORE, | 
|   431   }; |   431   }; | 
|   432   DCHECK(arraysize(icons) == NUM_TYPES); |   432   DCHECK(arraysize(icons) == NUM_TYPES); | 
|   433   return icons[type]; |   433   return icons[type]; | 
|   434 } |   434 } | 
|   435  |   435  | 
|   436 // static |   436 // static | 
|   437 bool AutocompleteMatch::MoreRelevant(const AutocompleteMatch& elem1, |   437 bool AutocompleteMatch::MoreRelevant(const AutocompleteMatch& elem1, | 
|   438                                      const AutocompleteMatch& elem2) { |   438                                      const AutocompleteMatch& elem2) { | 
|   439   // For equal-relevance matches, we sort alphabetically, so that providers |   439   // For equal-relevance matches, we sort alphabetically, so that providers | 
|   440   // who return multiple elements at the same priority get a "stable" sort |   440   // who return multiple elements at the same priority get a "stable" sort | 
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1007 void AutocompleteController::CheckIfDone() { |  1007 void AutocompleteController::CheckIfDone() { | 
|  1008   for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); |  1008   for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); | 
|  1009        ++i) { |  1009        ++i) { | 
|  1010     if (!(*i)->done()) { |  1010     if (!(*i)->done()) { | 
|  1011       done_ = false; |  1011       done_ = false; | 
|  1012       return; |  1012       return; | 
|  1013     } |  1013     } | 
|  1014   } |  1014   } | 
|  1015   done_ = true; |  1015   done_ = true; | 
|  1016 } |  1016 } | 
| OLD | NEW |