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 // For WinDDK ATL compatibility, these ATL headers must come first. | 5 // For WinDDK ATL compatibility, these ATL headers must come first. |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <atlbase.h> // NOLINT | 8 #include <atlbase.h> // NOLINT |
9 #include <atlwin.h> // NOLINT | 9 #include <atlwin.h> // NOLINT |
10 #endif | 10 #endif |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 void OmniboxResultView::Invalidate() { | 196 void OmniboxResultView::Invalidate() { |
197 keyword_icon_->SetImage(GetKeywordIcon()); | 197 keyword_icon_->SetImage(GetKeywordIcon()); |
198 // While the text in the RenderTexts may not have changed, the styling | 198 // While the text in the RenderTexts may not have changed, the styling |
199 // (color/bold) may need to change. So we reset them to cause them to be | 199 // (color/bold) may need to change. So we reset them to cause them to be |
200 // recomputed in OnPaint(). | 200 // recomputed in OnPaint(). |
201 ResetRenderTexts(); | 201 ResetRenderTexts(); |
202 SchedulePaint(); | 202 SchedulePaint(); |
203 } | 203 } |
204 | 204 |
205 gfx::Size OmniboxResultView::GetPreferredSize() { | 205 gfx::Size OmniboxResultView::GetPreferredSize() const { |
206 return gfx::Size(0, std::max( | 206 return gfx::Size(0, std::max( |
207 default_icon_size_ + (kMinimumIconVerticalPadding * 2), | 207 default_icon_size_ + (kMinimumIconVerticalPadding * 2), |
208 GetTextHeight() + (minimum_text_vertical_padding_ * 2))); | 208 GetTextHeight() + (minimum_text_vertical_padding_ * 2))); |
209 } | 209 } |
210 | 210 |
211 //////////////////////////////////////////////////////////////////////////////// | 211 //////////////////////////////////////////////////////////////////////////////// |
212 // OmniboxResultView, protected: | 212 // OmniboxResultView, protected: |
213 | 213 |
214 OmniboxResultView::ResultViewState OmniboxResultView::GetState() const { | 214 OmniboxResultView::ResultViewState OmniboxResultView::GetState() const { |
215 if (model_->IsSelectedIndex(model_index_)) | 215 if (model_->IsSelectedIndex(model_index_)) |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 } | 555 } |
556 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), | 556 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), |
557 keyword_description_rendertext_.get(), canvas, x); | 557 keyword_description_rendertext_.get(), canvas, x); |
558 } | 558 } |
559 } | 559 } |
560 | 560 |
561 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { | 561 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { |
562 Layout(); | 562 Layout(); |
563 SchedulePaint(); | 563 SchedulePaint(); |
564 } | 564 } |
OLD | NEW |