| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/autocomplete/autocomplete_match.h" | 10 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
| 12 #include "ui/base/animation/animation_delegate.h" | 12 #include "ui/base/animation/animation_delegate.h" |
| 13 #include "ui/base/animation/slide_animation.h" | 13 #include "ui/base/animation/slide_animation.h" |
| 14 #include "ui/gfx/font.h" | 14 #include "ui/gfx/font_list.h" |
| 15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 16 #include "ui/views/controls/image_view.h" | 16 #include "ui/views/controls/image_view.h" |
| 17 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
| 18 | 18 |
| 19 class LocationBarView; | 19 class LocationBarView; |
| 20 class OmniboxResultViewModel; | 20 class OmniboxResultViewModel; |
| 21 | 21 |
| 22 namespace gfx { | 22 namespace gfx { |
| 23 class Canvas; | 23 class Canvas; |
| 24 class RenderText; | 24 class RenderText; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 41 TEXT, | 41 TEXT, |
| 42 DIMMED_TEXT, | 42 DIMMED_TEXT, |
| 43 URL, | 43 URL, |
| 44 DIVIDER, | 44 DIVIDER, |
| 45 NUM_KINDS | 45 NUM_KINDS |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 OmniboxResultView(OmniboxResultViewModel* model, | 48 OmniboxResultView(OmniboxResultViewModel* model, |
| 49 int model_index, | 49 int model_index, |
| 50 LocationBarView* location_bar_view, | 50 LocationBarView* location_bar_view, |
| 51 const gfx::Font& font); | 51 const gfx::FontList& font_list); |
| 52 virtual ~OmniboxResultView(); | 52 virtual ~OmniboxResultView(); |
| 53 | 53 |
| 54 SkColor GetColor(ResultViewState state, ColorKind kind) const; | 54 SkColor GetColor(ResultViewState state, ColorKind kind) const; |
| 55 | 55 |
| 56 // Updates the match used to paint the contents of this result view. We copy | 56 // Updates the match used to paint the contents of this result view. We copy |
| 57 // the match so that we can continue to paint the last result even after the | 57 // the match so that we can continue to paint the last result even after the |
| 58 // model has changed. | 58 // model has changed. |
| 59 void SetMatch(const AutocompleteMatch& match); | 59 void SetMatch(const AutocompleteMatch& match); |
| 60 | 60 |
| 61 void ShowKeyword(bool show_keyword); | 61 void ShowKeyword(bool show_keyword); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 int edge_item_padding_; | 141 int edge_item_padding_; |
| 142 int item_padding_; | 142 int item_padding_; |
| 143 int minimum_text_vertical_padding_; | 143 int minimum_text_vertical_padding_; |
| 144 | 144 |
| 145 // This row's model and model index. | 145 // This row's model and model index. |
| 146 OmniboxResultViewModel* model_; | 146 OmniboxResultViewModel* model_; |
| 147 size_t model_index_; | 147 size_t model_index_; |
| 148 | 148 |
| 149 LocationBarView* location_bar_view_; | 149 LocationBarView* location_bar_view_; |
| 150 | 150 |
| 151 const gfx::Font font_; | 151 const gfx::FontList font_list_; |
| 152 int font_height_; | 152 int font_height_; |
| 153 | 153 |
| 154 // Width of the ellipsis in the normal font. | 154 // Width of the ellipsis in the normal font. |
| 155 int ellipsis_width_; | 155 int ellipsis_width_; |
| 156 | 156 |
| 157 // A context used for mirroring regions. | 157 // A context used for mirroring regions. |
| 158 class MirroringContext; | 158 class MirroringContext; |
| 159 scoped_ptr<MirroringContext> mirroring_context_; | 159 scoped_ptr<MirroringContext> mirroring_context_; |
| 160 | 160 |
| 161 AutocompleteMatch match_; | 161 AutocompleteMatch match_; |
| 162 | 162 |
| 163 gfx::Rect text_bounds_; | 163 gfx::Rect text_bounds_; |
| 164 gfx::Rect icon_bounds_; | 164 gfx::Rect icon_bounds_; |
| 165 | 165 |
| 166 gfx::Rect keyword_text_bounds_; | 166 gfx::Rect keyword_text_bounds_; |
| 167 scoped_ptr<views::ImageView> keyword_icon_; | 167 scoped_ptr<views::ImageView> keyword_icon_; |
| 168 | 168 |
| 169 scoped_ptr<ui::SlideAnimation> animation_; | 169 scoped_ptr<ui::SlideAnimation> animation_; |
| 170 | 170 |
| 171 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); | 171 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ | 174 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ |
| OLD | NEW |