| 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 "ash/app_list/app_list.h" | 5 #include "ash/app_list/app_list.h" |
| 6 | 6 |
| 7 #include "ash/app_list/app_list_model.h" | 7 #include "ash/app_list/app_list_model.h" |
| 8 #include "ash/app_list/app_list_view.h" | 8 #include "ash/app_list/app_list_view.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 //////////////////////////////////////////////////////////////////////////////// | 82 //////////////////////////////////////////////////////////////////////////////// |
| 83 // AppList, private: | 83 // AppList, private: |
| 84 | 84 |
| 85 void AppList::SetWidget(views::Widget* widget) { | 85 void AppList::SetWidget(views::Widget* widget) { |
| 86 DCHECK(widget_ == NULL); | 86 DCHECK(widget_ == NULL); |
| 87 | 87 |
| 88 if (is_visible_) { | 88 if (is_visible_) { |
| 89 widget_ = widget; | 89 widget_ = widget; |
| 90 GetLayer(widget_)->GetAnimator()->AddObserver(this); | 90 widget_->AddObserver(this); |
| 91 Shell::GetInstance()->AddRootWindowEventFilter(this); | 91 Shell::GetInstance()->AddRootWindowEventFilter(this); |
| 92 | 92 |
| 93 widget_->SetBounds(GetPreferredBounds(false)); | 93 widget_->SetBounds(GetPreferredBounds(false)); |
| 94 widget_->SetOpacity(0); | 94 widget_->SetOpacity(0); |
| 95 ScheduleAnimation(); | 95 ScheduleAnimation(); |
| 96 | 96 |
| 97 widget_->Show(); | 97 widget_->Show(); |
| 98 } else { | 98 } else { |
| 99 widget->Close(); | 99 widget->Close(); |
| 100 } | 100 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 | 183 |
| 184 void AppList::OnWidgetActivationChanged(views::Widget* widget, bool active) { | 184 void AppList::OnWidgetActivationChanged(views::Widget* widget, bool active) { |
| 185 DCHECK(widget_ == widget); | 185 DCHECK(widget_ == widget); |
| 186 if (widget_ && is_visible_ && !active) | 186 if (widget_ && is_visible_ && !active) |
| 187 SetVisible(false); | 187 SetVisible(false); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace internal | 190 } // namespace internal |
| 191 } // namespace ash | 191 } // namespace ash |
| OLD | NEW |