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 "ui/app_list/app_list_constants.h" | 9 #include "ui/app_list/app_list_constants.h" |
10 #include "ui/app_list/app_list_model.h" | 10 #include "ui/app_list/app_list_model.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 view_delegate_->AutoLaunchCanceled(); | 214 view_delegate_->AutoLaunchCanceled(); |
215 NotifyQueryChanged(); | 215 NotifyQueryChanged(); |
216 } | 216 } |
217 | 217 |
218 bool SearchBoxView::HandleKeyEvent(views::Textfield* sender, | 218 bool SearchBoxView::HandleKeyEvent(views::Textfield* sender, |
219 const ui::KeyEvent& key_event) { | 219 const ui::KeyEvent& key_event) { |
220 bool handled = false; | 220 bool handled = false; |
221 if (contents_view_ && contents_view_->visible()) | 221 if (contents_view_ && contents_view_->visible()) |
222 handled = contents_view_->OnKeyPressed(key_event); | 222 handled = contents_view_->OnKeyPressed(key_event); |
223 | 223 |
| 224 // Prevent Shift+Tab from locking up the whole chrome browser process. |
| 225 // Explicitly capturing the Shift+Tab event here compensates for a focus |
| 226 // search issue. We get away with this because there are no other focus |
| 227 // targets. See http://crbug.com/438425 for details. |
| 228 if (key_event.key_code() == ui::VKEY_TAB && key_event.IsShiftDown()) |
| 229 handled = true; |
| 230 |
224 return handled; | 231 return handled; |
225 } | 232 } |
226 | 233 |
227 void SearchBoxView::ButtonPressed(views::Button* sender, | 234 void SearchBoxView::ButtonPressed(views::Button* sender, |
228 const ui::Event& event) { | 235 const ui::Event& event) { |
229 if (back_button_ && sender == back_button_) | 236 if (back_button_ && sender == back_button_) |
230 delegate_->BackButtonPressed(); | 237 delegate_->BackButtonPressed(); |
231 else if (speech_button_ && sender == speech_button_) | 238 else if (speech_button_ && sender == speech_button_) |
232 view_delegate_->ToggleSpeechRecognition(); | 239 view_delegate_->ToggleSpeechRecognition(); |
233 else | 240 else |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 NotifyQueryChanged(); | 298 NotifyQueryChanged(); |
292 } | 299 } |
293 | 300 |
294 void SearchBoxView::OnSpeechRecognitionStateChanged( | 301 void SearchBoxView::OnSpeechRecognitionStateChanged( |
295 SpeechRecognitionState new_state) { | 302 SpeechRecognitionState new_state) { |
296 SpeechRecognitionButtonPropChanged(); | 303 SpeechRecognitionButtonPropChanged(); |
297 SchedulePaint(); | 304 SchedulePaint(); |
298 } | 305 } |
299 | 306 |
300 } // namespace app_list | 307 } // namespace app_list |
OLD | NEW |