| 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/gfx/animation/animation_delegate.h" |
| 13 #include "ui/base/animation/slide_animation.h" | 13 #include "ui/gfx/animation/slide_animation.h" |
| 14 #include "ui/gfx/font_list.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; |
| 25 } | 25 } |
| 26 | 26 |
| 27 class OmniboxResultView : public views::View, | 27 class OmniboxResultView : public views::View, |
| 28 private ui::AnimationDelegate { | 28 private gfx::AnimationDelegate { |
| 29 public: | 29 public: |
| 30 // Keep these ordered from least dominant (normal) to most dominant | 30 // Keep these ordered from least dominant (normal) to most dominant |
| 31 // (selected). | 31 // (selected). |
| 32 enum ResultViewState { | 32 enum ResultViewState { |
| 33 NORMAL = 0, | 33 NORMAL = 0, |
| 34 HOVERED, | 34 HOVERED, |
| 35 SELECTED, | 35 SELECTED, |
| 36 NUM_STATES | 36 NUM_STATES |
| 37 }; | 37 }; |
| 38 | 38 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // LTR_STRING ...RTS_LTR | 125 // LTR_STRING ...RTS_LTR |
| 126 // Instead of: | 126 // Instead of: |
| 127 // LTR_STRING RTS_LTR... | 127 // LTR_STRING RTS_LTR... |
| 128 void Elide(Runs* runs, int remaining_width) const; | 128 void Elide(Runs* runs, int remaining_width) const; |
| 129 | 129 |
| 130 // views::View: | 130 // views::View: |
| 131 virtual void Layout() OVERRIDE; | 131 virtual void Layout() OVERRIDE; |
| 132 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 132 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
| 133 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 133 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 134 | 134 |
| 135 // ui::AnimationDelegate: | 135 // gfx::AnimationDelegate: |
| 136 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 136 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
| 137 | 137 |
| 138 static int default_icon_size_; | 138 static int default_icon_size_; |
| 139 | 139 |
| 140 // Default values cached here, may be overridden using the setters above. | 140 // Default values cached here, may be overridden using the setters above. |
| 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_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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<gfx::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 |