| 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 #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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |