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 "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 void SearchBoxView::NotifyQueryChanged() { | 338 void SearchBoxView::NotifyQueryChanged() { |
339 DCHECK(delegate_); | 339 DCHECK(delegate_); |
340 delegate_->QueryChanged(this); | 340 delegate_->QueryChanged(this); |
341 } | 341 } |
342 | 342 |
343 void SearchBoxView::ContentsChanged(views::Textfield* sender, | 343 void SearchBoxView::ContentsChanged(views::Textfield* sender, |
344 const base::string16& new_contents) { | 344 const base::string16& new_contents) { |
345 UpdateModel(); | 345 UpdateModel(); |
346 view_delegate_->AutoLaunchCanceled(); | 346 view_delegate_->AutoLaunchCanceled(); |
347 NotifyQueryChanged(); | 347 NotifyQueryChanged(); |
348 | 348 if (IsFullscreenAppListEnabled()) |
349 if (IsFullscreenAppListEnabled() && !app_list_view_->is_fullscreen()) { | 349 app_list_view_->SetStateFromSearchBoxView(search_box_->text().empty()); |
350 // If the app list is in the peeking state, switch it to fullscreen. | |
351 app_list_view_->SetState(AppListView::FULLSCREEN); | |
352 } | |
353 } | 350 } |
354 | 351 |
355 bool SearchBoxView::HandleKeyEvent(views::Textfield* sender, | 352 bool SearchBoxView::HandleKeyEvent(views::Textfield* sender, |
356 const ui::KeyEvent& key_event) { | 353 const ui::KeyEvent& key_event) { |
357 if (key_event.type() == ui::ET_KEY_PRESSED) { | 354 if (key_event.type() == ui::ET_KEY_PRESSED) { |
358 if (key_event.key_code() == ui::VKEY_TAB && | 355 if (key_event.key_code() == ui::VKEY_TAB && |
359 focused_view_ != FOCUS_CONTENTS_VIEW && | 356 focused_view_ != FOCUS_CONTENTS_VIEW && |
360 MoveTabFocus(key_event.IsShiftDown())) | 357 MoveTabFocus(key_event.IsShiftDown())) |
361 return true; | 358 return true; |
362 | 359 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 NotifyQueryChanged(); | 455 NotifyQueryChanged(); |
459 } | 456 } |
460 | 457 |
461 void SearchBoxView::OnSpeechRecognitionStateChanged( | 458 void SearchBoxView::OnSpeechRecognitionStateChanged( |
462 SpeechRecognitionState new_state) { | 459 SpeechRecognitionState new_state) { |
463 SpeechRecognitionButtonPropChanged(); | 460 SpeechRecognitionButtonPropChanged(); |
464 SchedulePaint(); | 461 SchedulePaint(); |
465 } | 462 } |
466 | 463 |
467 } // namespace app_list | 464 } // namespace app_list |
OLD | NEW |