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