Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Side by Side Diff: ui/app_list/views/search_box_view.cc

Issue 1693713004: Don't fire a FOCUS accessibility event on a View that doesn't have focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed one call to SendFocusAlert Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "ui/app_list/views/search_box_view.h" 5 #include "ui/app_list/views/search_box_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 ~SearchBoxImageButton() override {} 81 ~SearchBoxImageButton() override {}
82 82
83 bool selected() { return selected_; } 83 bool selected() { return selected_; }
84 void SetSelected(bool selected) { 84 void SetSelected(bool selected) {
85 if (selected_ == selected) 85 if (selected_ == selected)
86 return; 86 return;
87 87
88 selected_ = selected; 88 selected_ = selected;
89 SchedulePaint(); 89 SchedulePaint();
90 if (selected) 90 if (selected)
91 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true); 91 NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true);
92 } 92 }
93 93
94 bool OnKeyPressed(const ui::KeyEvent& event) override { 94 bool OnKeyPressed(const ui::KeyEvent& event) override {
95 // Disable space key to press the button. The keyboard events received 95 // Disable space key to press the button. The keyboard events received
96 // by this view are forwarded from a Textfield (SearchBoxView) and key 96 // by this view are forwarded from a Textfield (SearchBoxView) and key
97 // released events are not forwarded. This leaves the button in pressed 97 // released events are not forwarded. This leaves the button in pressed
98 // state. 98 // state.
99 if (event.key_code() == ui::VKEY_SPACE) 99 if (event.key_code() == ui::VKEY_SPACE)
100 return false; 100 return false;
101 101
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 NotifyQueryChanged(); 464 NotifyQueryChanged();
465 } 465 }
466 466
467 void SearchBoxView::OnSpeechRecognitionStateChanged( 467 void SearchBoxView::OnSpeechRecognitionStateChanged(
468 SpeechRecognitionState new_state) { 468 SpeechRecognitionState new_state) {
469 SpeechRecognitionButtonPropChanged(); 469 SpeechRecognitionButtonPropChanged();
470 SchedulePaint(); 470 SchedulePaint();
471 } 471 }
472 472
473 } // namespace app_list 473 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc ('k') | ui/app_list/views/search_result_list_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698