| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 287 } |
| 288 | 288 |
| 289 void OmniboxResultView::OnSelected() { | 289 void OmniboxResultView::OnSelected() { |
| 290 DCHECK_EQ(SELECTED, GetState()); | 290 DCHECK_EQ(SELECTED, GetState()); |
| 291 | 291 |
| 292 // Notify assistive technology when results with answers attached are | 292 // Notify assistive technology when results with answers attached are |
| 293 // selected. The non-answer text is already accessible as a consequence of | 293 // selected. The non-answer text is already accessible as a consequence of |
| 294 // updating the text in the omnibox but this alert and GetAccessibleNodeData | 294 // updating the text in the omnibox but this alert and GetAccessibleNodeData |
| 295 // below make the answer contents accessible. | 295 // below make the answer contents accessible. |
| 296 if (match_.answer) | 296 if (match_.answer) |
| 297 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 297 NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); |
| 298 } | 298 } |
| 299 | 299 |
| 300 gfx::Size OmniboxResultView::GetPreferredSize() const { | 300 gfx::Size OmniboxResultView::GetPreferredSize() const { |
| 301 int height = GetTextHeight() + (2 * GetVerticalMargin()); | 301 int height = GetTextHeight() + (2 * GetVerticalMargin()); |
| 302 if (match_.answer) | 302 if (match_.answer) |
| 303 height += GetAnswerHeight() + kVerticalPadding; | 303 height += GetAnswerHeight() + kVerticalPadding; |
| 304 return gfx::Size(0, height); | 304 return gfx::Size(0, height); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void OmniboxResultView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 307 void OmniboxResultView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 destination->AppendText(text); | 802 destination->AppendText(text); |
| 803 const TextStyle& text_style = GetTextStyle(text_type); | 803 const TextStyle& text_style = GetTextStyle(text_type); |
| 804 // TODO(dschuyler): follow up on the problem of different font sizes within | 804 // TODO(dschuyler): follow up on the problem of different font sizes within |
| 805 // one RenderText. Maybe with destination->SetFontList(...). | 805 // one RenderText. Maybe with destination->SetFontList(...). |
| 806 destination->ApplyWeight( | 806 destination->ApplyWeight( |
| 807 is_bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL, range); | 807 is_bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL, range); |
| 808 destination->ApplyColor( | 808 destination->ApplyColor( |
| 809 GetNativeTheme()->GetSystemColor(text_style.colors[GetState()]), range); | 809 GetNativeTheme()->GetSystemColor(text_style.colors[GetState()]), range); |
| 810 destination->ApplyBaselineStyle(text_style.baseline, range); | 810 destination->ApplyBaselineStyle(text_style.baseline, range); |
| 811 } | 811 } |
| OLD | NEW |