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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_VIEW_MODEL_H_ 6 #define CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_VIEW_MODEL_H_ 7 #pragma once 8 9 class SkBitmap; 10 11 // An interface implemented by an object that provides data to populate 12 // individual result views. 13 class AutocompleteResultViewModel { 14 public: 15 // Returns true if the index is selected. 16 virtual bool IsSelectedIndex(size_t index) const = 0; 17 18 // Returns true if the index is hovered. 19 virtual bool IsHoveredIndex(size_t index) const = 0; 20 21 // If |index| is a match from an extension, returns the extension icon; 22 // otherwise returns NULL. 23 virtual const SkBitmap* GetIconIfExtensionMatch(size_t index) const = 0; 24 }; 25 26 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_VIEW_MODEL_H_ 27