Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: chrome/browser/ui/views/autocomplete/autocomplete_result_view.h

Issue 10382144: Change SetImage, SetBackground, and SetToggledImage to take in a gfx::ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 struct RunData; 88 struct RunData;
89 typedef std::vector<RunData> Runs; 89 typedef std::vector<RunData> Runs;
90 90
91 // Predicate functions for use when sorting the runs. 91 // Predicate functions for use when sorting the runs.
92 static bool SortRunsLogically(const RunData& lhs, const RunData& rhs); 92 static bool SortRunsLogically(const RunData& lhs, const RunData& rhs);
93 static bool SortRunsVisually(const RunData& lhs, const RunData& rhs); 93 static bool SortRunsVisually(const RunData& lhs, const RunData& rhs);
94 94
95 ResultViewState GetState() const; 95 ResultViewState GetState() const;
96 const SkBitmap* GetIcon() const; 96 const SkBitmap* GetIcon() const;
97 const SkBitmap* GetKeywordIcon() const; 97 const gfx::ImageSkia* GetKeywordIcon() const;
98 98
99 // Elides |runs| to fit in |remaining_width|. The runs in |runs| should be in 99 // Elides |runs| to fit in |remaining_width|. The runs in |runs| should be in
100 // logical order. 100 // logical order.
101 // 101 //
102 // When we need to elide a run, the ellipsis will be placed at the end of that 102 // When we need to elide a run, the ellipsis will be placed at the end of that
103 // run. This means that if we elide a run whose visual direction is opposite 103 // run. This means that if we elide a run whose visual direction is opposite
104 // that of the drawing context, the ellipsis will not be at the "end" of the 104 // that of the drawing context, the ellipsis will not be at the "end" of the
105 // drawn string. For example, if in an LTR context we have the LTR run 105 // drawn string. For example, if in an LTR context we have the LTR run
106 // "LTR_STRING" and the RTL run "RTL_STRING", the unelided text would be drawn 106 // "LTR_STRING" and the RTL run "RTL_STRING", the unelided text would be drawn
107 // like: 107 // like:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 gfx::Rect keyword_text_bounds_; 144 gfx::Rect keyword_text_bounds_;
145 scoped_ptr<views::ImageView> keyword_icon_; 145 scoped_ptr<views::ImageView> keyword_icon_;
146 146
147 scoped_ptr<ui::SlideAnimation> animation_; 147 scoped_ptr<ui::SlideAnimation> animation_;
148 148
149 DISALLOW_COPY_AND_ASSIGN(AutocompleteResultView); 149 DISALLOW_COPY_AND_ASSIGN(AutocompleteResultView);
150 }; 150 };
151 151
152 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_VIEW_H_ 152 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698