| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 void AppListView::OnWidgetDestroying(views::Widget* widget) { | 614 void AppListView::OnWidgetDestroying(views::Widget* widget) { |
| 615 BubbleDialogDelegateView::OnWidgetDestroying(widget); | 615 BubbleDialogDelegateView::OnWidgetDestroying(widget); |
| 616 if (delegate_ && widget == GetWidget()) | 616 if (delegate_ && widget == GetWidget()) |
| 617 delegate_->ViewClosing(); | 617 delegate_->ViewClosing(); |
| 618 } | 618 } |
| 619 | 619 |
| 620 void AppListView::OnWidgetActivationChanged(views::Widget* widget, | 620 void AppListView::OnWidgetActivationChanged(views::Widget* widget, |
| 621 bool active) { | 621 bool active) { |
| 622 // Do not called inherited function as the bubble delegate auto close | 622 // Do not called inherited function as the bubble delegate auto close |
| 623 // functionality is not used. | 623 // functionality is not used. |
| 624 if (widget == GetWidget()) | 624 if (widget == GetWidget()) { |
| 625 FOR_EACH_OBSERVER(AppListViewObserver, observers_, | 625 for (auto& observer : observers_) |
| 626 OnActivationChanged(widget, active)); | 626 observer.OnActivationChanged(widget, active); |
| 627 } |
| 627 } | 628 } |
| 628 | 629 |
| 629 void AppListView::OnWidgetVisibilityChanged(views::Widget* widget, | 630 void AppListView::OnWidgetVisibilityChanged(views::Widget* widget, |
| 630 bool visible) { | 631 bool visible) { |
| 631 BubbleDialogDelegateView::OnWidgetVisibilityChanged(widget, visible); | 632 BubbleDialogDelegateView::OnWidgetVisibilityChanged(widget, visible); |
| 632 | 633 |
| 633 if (widget != GetWidget()) | 634 if (widget != GetWidget()) |
| 634 return; | 635 return; |
| 635 | 636 |
| 636 if (!visible) | 637 if (!visible) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 app_list_main_view_->SetVisible(true); | 700 app_list_main_view_->SetVisible(true); |
| 700 // Refocus the search box. However, if the app list widget does not have | 701 // Refocus the search box. However, if the app list widget does not have |
| 701 // focus, it means another window has already taken focus, and we *must not* | 702 // focus, it means another window has already taken focus, and we *must not* |
| 702 // focus the search box (or we would steal focus back into the app list). | 703 // focus the search box (or we would steal focus back into the app list). |
| 703 if (GetWidget()->IsActive()) | 704 if (GetWidget()->IsActive()) |
| 704 search_box_view_->search_box()->RequestFocus(); | 705 search_box_view_->search_box()->RequestFocus(); |
| 705 } | 706 } |
| 706 } | 707 } |
| 707 | 708 |
| 708 } // namespace app_list | 709 } // namespace app_list |
| OLD | NEW |