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 "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Updates the match used to paint the contents of this result view. We copy | 57 // Updates the match used to paint the contents of this result view. We copy |
58 // the match so that we can continue to paint the last result even after the | 58 // the match so that we can continue to paint the last result even after the |
59 // model has changed. | 59 // model has changed. |
60 void SetMatch(const AutocompleteMatch& match); | 60 void SetMatch(const AutocompleteMatch& match); |
61 | 61 |
62 void ShowKeyword(bool show_keyword); | 62 void ShowKeyword(bool show_keyword); |
63 | 63 |
64 void Invalidate(); | 64 void Invalidate(); |
65 | 65 |
66 // views::View: | 66 // views::View: |
67 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 67 virtual gfx::Size GetPreferredSize() const override; |
68 | 68 |
69 ResultViewState GetState() const; | 69 ResultViewState GetState() const; |
70 | 70 |
71 // Returns the height of the text portion of the result view. In the base | 71 // Returns the height of the text portion of the result view. In the base |
72 // class, this is the height of one line of text. | 72 // class, this is the height of one line of text. |
73 virtual int GetTextHeight() const; | 73 virtual int GetTextHeight() const; |
74 | 74 |
75 // Returns the display width required for the match contents. | 75 // Returns the display width required for the match contents. |
76 int GetMatchContentsWidth() const; | 76 int GetMatchContentsWidth() const; |
77 | 77 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 bool ShowOnlyKeywordMatch() const; | 127 bool ShowOnlyKeywordMatch() const; |
128 | 128 |
129 // Resets all RenderTexts for contents and description of the |match_| and its | 129 // Resets all RenderTexts for contents and description of the |match_| and its |
130 // associated keyword match. | 130 // associated keyword match. |
131 void ResetRenderTexts() const; | 131 void ResetRenderTexts() const; |
132 | 132 |
133 // Initializes |contents_rendertext_| if it is NULL. | 133 // Initializes |contents_rendertext_| if it is NULL. |
134 void InitContentsRenderTextIfNecessary() const; | 134 void InitContentsRenderTextIfNecessary() const; |
135 | 135 |
136 // views::View: | 136 // views::View: |
137 virtual void Layout() OVERRIDE; | 137 virtual void Layout() override; |
138 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 138 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
139 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 139 virtual void OnPaint(gfx::Canvas* canvas) override; |
140 | 140 |
141 // gfx::AnimationDelegate: | 141 // gfx::AnimationDelegate: |
142 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 142 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
143 | 143 |
144 // Returns the offset at which the contents of the |match| should be displayed | 144 // Returns the offset at which the contents of the |match| should be displayed |
145 // within the text bounds. The directionality of UI and match contents is used | 145 // within the text bounds. The directionality of UI and match contents is used |
146 // to determine the offset relative to the correct edge. | 146 // to determine the offset relative to the correct edge. |
147 int GetDisplayOffset(const AutocompleteMatch& match, | 147 int GetDisplayOffset(const AutocompleteMatch& match, |
148 bool is_ui_rtl, | 148 bool is_ui_rtl, |
149 bool is_match_contents_rtl) const; | 149 bool is_match_contents_rtl) const; |
150 | 150 |
151 static int default_icon_size_; | 151 static int default_icon_size_; |
152 | 152 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 mutable scoped_ptr<gfx::RenderText> separator_rendertext_; | 185 mutable scoped_ptr<gfx::RenderText> separator_rendertext_; |
186 mutable scoped_ptr<gfx::RenderText> keyword_contents_rendertext_; | 186 mutable scoped_ptr<gfx::RenderText> keyword_contents_rendertext_; |
187 mutable scoped_ptr<gfx::RenderText> keyword_description_rendertext_; | 187 mutable scoped_ptr<gfx::RenderText> keyword_description_rendertext_; |
188 | 188 |
189 mutable int separator_width_; | 189 mutable int separator_width_; |
190 | 190 |
191 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); | 191 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); |
192 }; | 192 }; |
193 | 193 |
194 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ | 194 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ |
OLD | NEW |