| 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_popup_model.h" | 5 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 8 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" | 9 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| 11 #include "chrome/browser/extensions/extensions_service.h" |
| 11 #include "chrome/browser/search_engines/template_url.h" | 12 #include "chrome/browser/search_engines/template_url.h" |
| 12 #include "chrome/browser/search_engines/template_url_model.h" | 13 #include "chrome/browser/search_engines/template_url_model.h" |
| 13 #include "chrome/common/notification_service.h" | 14 #include "chrome/common/notification_service.h" |
| 14 #include "third_party/icu/public/common/unicode/ubidi.h" | 15 #include "third_party/icu/public/common/unicode/ubidi.h" |
| 15 | 16 |
| 16 /////////////////////////////////////////////////////////////////////////////// | 17 /////////////////////////////////////////////////////////////////////////////// |
| 17 // AutocompletePopupModel | 18 // AutocompletePopupModel |
| 18 | 19 |
| 19 AutocompletePopupModel::AutocompletePopupModel( | 20 AutocompletePopupModel::AutocompletePopupModel( |
| 20 AutocompletePopupView* popup_view, | 21 AutocompletePopupView* popup_view, |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // There had better not be a nonempty result set with no default match. | 273 // There had better not be a nonempty result set with no default match. |
| 273 CHECK((selected_line_ != kNoMatch) || result->empty()); | 274 CHECK((selected_line_ != kNoMatch) || result->empty()); |
| 274 // If we're going to trim the window size to no longer include the hovered | 275 // If we're going to trim the window size to no longer include the hovered |
| 275 // line, turn hover off. Practically, this shouldn't happen, but it | 276 // line, turn hover off. Practically, this shouldn't happen, but it |
| 276 // doesn't hurt to be defensive. | 277 // doesn't hurt to be defensive. |
| 277 if ((hovered_line_ != kNoMatch) && (result->size() <= hovered_line_)) | 278 if ((hovered_line_ != kNoMatch) && (result->size() <= hovered_line_)) |
| 278 SetHoveredLine(kNoMatch); | 279 SetHoveredLine(kNoMatch); |
| 279 | 280 |
| 280 view_->UpdatePopupAppearance(); | 281 view_->UpdatePopupAppearance(); |
| 281 } | 282 } |
| 283 |
| 284 const SkBitmap* AutocompletePopupModel::GetSpecialIconForMatch( |
| 285 const AutocompleteMatch& match) const { |
| 286 if (!match.template_url || !match.template_url->IsExtensionKeyword()) |
| 287 return NULL; |
| 288 |
| 289 return &profile_->GetExtensionsService()->GetOmniboxIcon( |
| 290 match.template_url->GetExtensionId()); |
| 291 } |
| OLD | NEW |