| 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 "chrome/browser/autocomplete/autocomplete_match.h" | 8 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/base/animation/animation_delegate.h" | 10 #include "ui/base/animation/animation_delegate.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 struct ClassificationData; | 95 struct ClassificationData; |
| 96 typedef std::vector<ClassificationData> Classifications; | 96 typedef std::vector<ClassificationData> Classifications; |
| 97 | 97 |
| 98 struct RunData; | 98 struct RunData; |
| 99 typedef std::vector<RunData> Runs; | 99 typedef std::vector<RunData> Runs; |
| 100 | 100 |
| 101 // Predicate functions for use when sorting the runs. | 101 // Predicate functions for use when sorting the runs. |
| 102 static bool SortRunsLogically(const RunData& lhs, const RunData& rhs); | 102 static bool SortRunsLogically(const RunData& lhs, const RunData& rhs); |
| 103 static bool SortRunsVisually(const RunData& lhs, const RunData& rhs); | 103 static bool SortRunsVisually(const RunData& lhs, const RunData& rhs); |
| 104 | 104 |
| 105 const SkBitmap* GetIcon() const; | 105 gfx::ImageSkia GetIcon() const; |
| 106 const gfx::ImageSkia* GetKeywordIcon() const; | 106 const gfx::ImageSkia* GetKeywordIcon() const; |
| 107 | 107 |
| 108 // Elides |runs| to fit in |remaining_width|. The runs in |runs| should be in | 108 // Elides |runs| to fit in |remaining_width|. The runs in |runs| should be in |
| 109 // logical order. | 109 // logical order. |
| 110 // | 110 // |
| 111 // When we need to elide a run, the ellipsis will be placed at the end of that | 111 // When we need to elide a run, the ellipsis will be placed at the end of that |
| 112 // run. This means that if we elide a run whose visual direction is opposite | 112 // run. This means that if we elide a run whose visual direction is opposite |
| 113 // that of the drawing context, the ellipsis will not be at the "end" of the | 113 // that of the drawing context, the ellipsis will not be at the "end" of the |
| 114 // drawn string. For example, if in an LTR context we have the LTR run | 114 // drawn string. For example, if in an LTR context we have the LTR run |
| 115 // "LTR_STRING" and the RTL run "RTL_STRING", the unelided text would be drawn | 115 // "LTR_STRING" and the RTL run "RTL_STRING", the unelided text would be drawn |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 gfx::Rect keyword_text_bounds_; | 158 gfx::Rect keyword_text_bounds_; |
| 159 scoped_ptr<views::ImageView> keyword_icon_; | 159 scoped_ptr<views::ImageView> keyword_icon_; |
| 160 | 160 |
| 161 scoped_ptr<ui::SlideAnimation> animation_; | 161 scoped_ptr<ui::SlideAnimation> animation_; |
| 162 | 162 |
| 163 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); | 163 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ | 166 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ |
| OLD | NEW |