1 // Copyright (c) 2012 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_OMNIBOX_OMNIBOX_RESULT_VIEW_MODEL_H_ 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_MODEL_H_ 7 8 namespace gfx { 9 class Image; 10 } 11 12 // An interface implemented by an object that provides data to populate 13 // individual result views. 14 class OmniboxResultViewModel { 15 public: 16 // Returns true if the index is selected. 17 virtual bool IsSelectedIndex(size_t index) const = 0; 18 19 // Returns true if the index is hovered. 20 virtual bool IsHoveredIndex(size_t index) const = 0; 21 22 // If |index| is a match from an extension, returns the extension icon; 23 // otherwise returns an empty gfx::Image. 24 virtual gfx::Image GetIconIfExtensionMatch(size_t index) const = 0; 25 }; 26 27 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_MODEL_H_ 28