| 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 | 7 |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include <atlbase.h> // NOLINT | 9 #include <atlbase.h> // NOLINT |
| 10 #include <atlwin.h> // NOLINT | 10 #include <atlwin.h> // NOLINT |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 294 } |
| 295 | 295 |
| 296 void OmniboxResultView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 296 void OmniboxResultView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 297 node_data->SetName(match_.answer | 297 node_data->SetName(match_.answer |
| 298 ? l10n_util::GetStringFUTF16( | 298 ? l10n_util::GetStringFUTF16( |
| 299 IDS_OMNIBOX_ACCESSIBLE_ANSWER, match_.contents, | 299 IDS_OMNIBOX_ACCESSIBLE_ANSWER, match_.contents, |
| 300 match_.answer->second_line().AccessibleText()) | 300 match_.answer->second_line().AccessibleText()) |
| 301 : match_.contents); | 301 : match_.contents); |
| 302 } | 302 } |
| 303 | 303 |
| 304 void OmniboxResultView::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
| 305 Invalidate(); |
| 306 SchedulePaint(); |
| 307 } |
| 308 |
| 304 //////////////////////////////////////////////////////////////////////////////// | 309 //////////////////////////////////////////////////////////////////////////////// |
| 305 // OmniboxResultView, protected: | 310 // OmniboxResultView, protected: |
| 306 | 311 |
| 307 OmniboxResultView::ResultViewState OmniboxResultView::GetState() const { | 312 OmniboxResultView::ResultViewState OmniboxResultView::GetState() const { |
| 308 if (model_->IsSelectedIndex(model_index_)) | 313 if (model_->IsSelectedIndex(model_index_)) |
| 309 return SELECTED; | 314 return SELECTED; |
| 310 return model_->IsHoveredIndex(model_index_) ? HOVERED : NORMAL; | 315 return model_->IsHoveredIndex(model_index_) ? HOVERED : NORMAL; |
| 311 } | 316 } |
| 312 | 317 |
| 313 int OmniboxResultView::GetTextHeight() const { | 318 int OmniboxResultView::GetTextHeight() const { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 destination->AppendText(text); | 773 destination->AppendText(text); |
| 769 const TextStyle& text_style = GetTextStyle(text_type); | 774 const TextStyle& text_style = GetTextStyle(text_type); |
| 770 // TODO(dschuyler): follow up on the problem of different font sizes within | 775 // TODO(dschuyler): follow up on the problem of different font sizes within |
| 771 // one RenderText. Maybe with destination->SetFontList(...). | 776 // one RenderText. Maybe with destination->SetFontList(...). |
| 772 destination->ApplyWeight( | 777 destination->ApplyWeight( |
| 773 is_bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL, range); | 778 is_bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL, range); |
| 774 destination->ApplyColor( | 779 destination->ApplyColor( |
| 775 GetNativeTheme()->GetSystemColor(text_style.colors[GetState()]), range); | 780 GetNativeTheme()->GetSystemColor(text_style.colors[GetState()]), range); |
| 776 destination->ApplyBaselineStyle(text_style.baseline, range); | 781 destination->ApplyBaselineStyle(text_style.baseline, range); |
| 777 } | 782 } |
| OLD | NEW |