| 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 const char* OmniboxResultView::GetClassName() const { |
| 206 return "OmniboxResultView"; |
| 207 } |
| 208 |
| 205 gfx::Size OmniboxResultView::GetPreferredSize() const { | 209 gfx::Size OmniboxResultView::GetPreferredSize() const { |
| 206 return gfx::Size(0, std::max( | 210 return gfx::Size(0, std::max( |
| 207 default_icon_size_ + (kMinimumIconVerticalPadding * 2), | 211 default_icon_size_ + (kMinimumIconVerticalPadding * 2), |
| 208 GetTextHeight() + (minimum_text_vertical_padding_ * 2))); | 212 GetTextHeight() + (minimum_text_vertical_padding_ * 2))); |
| 209 } | 213 } |
| 210 | 214 |
| 211 //////////////////////////////////////////////////////////////////////////////// | 215 //////////////////////////////////////////////////////////////////////////////// |
| 212 // OmniboxResultView, protected: | 216 // OmniboxResultView, protected: |
| 213 | 217 |
| 214 OmniboxResultView::ResultViewState OmniboxResultView::GetState() const { | 218 OmniboxResultView::ResultViewState OmniboxResultView::GetState() const { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 560 } |
| 557 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), | 561 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), |
| 558 keyword_description_rendertext_.get(), canvas, x); | 562 keyword_description_rendertext_.get(), canvas, x); |
| 559 } | 563 } |
| 560 } | 564 } |
| 561 | 565 |
| 562 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { | 566 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { |
| 563 Layout(); | 567 Layout(); |
| 564 SchedulePaint(); | 568 SchedulePaint(); |
| 565 } | 569 } |
| OLD | NEW |