| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/views/first_run_search_engine_view.h" | 5 #include "chrome/browser/ui/views/first_run_search_engine_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 SchedulePaint(); | 279 SchedulePaint(); |
| 280 | 280 |
| 281 // If the widget has detected that a screenreader is running, change the | 281 // If the widget has detected that a screenreader is running, change the |
| 282 // button names from "Choose" to the name of the search engine. This works | 282 // button names from "Choose" to the name of the search engine. This works |
| 283 // around a bug that JAWS ignores the accessible name of a native button. | 283 // around a bug that JAWS ignores the accessible name of a native button. |
| 284 if (GetWidget() && GetWidget()->IsAccessibleWidget()) { | 284 if (GetWidget() && GetWidget()->IsAccessibleWidget()) { |
| 285 std::vector<SearchEngineChoice*>::iterator it; | 285 std::vector<SearchEngineChoice*>::iterator it; |
| 286 for (it = search_engine_choices_.begin(); | 286 for (it = search_engine_choices_.begin(); |
| 287 it != search_engine_choices_.end(); | 287 it != search_engine_choices_.end(); |
| 288 it++) { | 288 it++) { |
| 289 (*it)->SetLabel((*it)->GetSearchEngine()->short_name()); | 289 (*it)->SetText((*it)->GetSearchEngine()->short_name()); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 // This will tell screenreaders that they should read the full text | 293 // This will tell screenreaders that they should read the full text |
| 294 // of this dialog to the user now (rather than waiting for the user | 294 // of this dialog to the user now (rather than waiting for the user |
| 295 // to explore it). | 295 // to explore it). |
| 296 GetWidget()->NotifyAccessibilityEvent( | 296 GetWidget()->NotifyAccessibilityEvent( |
| 297 this, ui::AccessibilityTypes::EVENT_ALERT, true); | 297 this, ui::AccessibilityTypes::EVENT_ALERT, true); |
| 298 } | 298 } |
| 299 | 299 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 456 } |
| 457 | 457 |
| 458 void FirstRunSearchEngineView::GetAccessibleState( | 458 void FirstRunSearchEngineView::GetAccessibleState( |
| 459 ui::AccessibleViewState* state) { | 459 ui::AccessibleViewState* state) { |
| 460 state->role = ui::AccessibilityTypes::ROLE_ALERT; | 460 state->role = ui::AccessibilityTypes::ROLE_ALERT; |
| 461 } | 461 } |
| 462 | 462 |
| 463 std::wstring FirstRunSearchEngineView::GetWindowTitle() const { | 463 std::wstring FirstRunSearchEngineView::GetWindowTitle() const { |
| 464 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_FIRSTRUN_DLG_TITLE)); | 464 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_FIRSTRUN_DLG_TITLE)); |
| 465 } | 465 } |
| OLD | NEW |