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/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 OnActivationChanged(widget, active)); | 432 OnActivationChanged(widget, active)); |
433 } | 433 } |
434 | 434 |
435 void AppListView::OnWidgetVisibilityChanged(views::Widget* widget, | 435 void AppListView::OnWidgetVisibilityChanged(views::Widget* widget, |
436 bool visible) { | 436 bool visible) { |
437 BubbleDelegateView::OnWidgetVisibilityChanged(widget, visible); | 437 BubbleDelegateView::OnWidgetVisibilityChanged(widget, visible); |
438 | 438 |
439 if (widget != GetWidget()) | 439 if (widget != GetWidget()) |
440 return; | 440 return; |
441 | 441 |
442 // We clear the search when hiding so the next time the app list appears it is | |
443 // not showing search results. | |
444 if (!visible) | 442 if (!visible) |
445 app_list_main_view_->search_box_view()->ClearSearch(); | 443 app_list_main_view_->ResetForShow(); |
446 | 444 |
447 // Whether we need to signin or not may have changed since last time we were | 445 // Whether we need to signin or not may have changed since last time we were |
448 // shown. | 446 // shown. |
449 Layout(); | 447 Layout(); |
450 } | 448 } |
451 | 449 |
452 void AppListView::OnSpeechRecognitionStateChanged( | 450 void AppListView::OnSpeechRecognitionStateChanged( |
453 SpeechRecognitionState new_state) { | 451 SpeechRecognitionState new_state) { |
454 if (signin_view_->visible() || !speech_view_) | 452 if (signin_view_->visible() || !speech_view_) |
455 return; | 453 return; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 #else | 501 #else |
504 speech_view_->SetVisible(recognizing); | 502 speech_view_->SetVisible(recognizing); |
505 app_list_main_view_->SetVisible(!recognizing); | 503 app_list_main_view_->SetVisible(!recognizing); |
506 | 504 |
507 // Needs to schedule paint of AppListView itself, to repaint the background. | 505 // Needs to schedule paint of AppListView itself, to repaint the background. |
508 GetBubbleFrameView()->SchedulePaint(); | 506 GetBubbleFrameView()->SchedulePaint(); |
509 #endif | 507 #endif |
510 } | 508 } |
511 | 509 |
512 } // namespace app_list | 510 } // namespace app_list |
OLD | NEW |