OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/presenter/app_list_presenter_impl.h" | 5 #include "ui/app_list/presenter/app_list_presenter_impl.h" |
6 | 6 |
7 #include "ui/app_list/app_list_constants.h" | 7 #include "ui/app_list/app_list_constants.h" |
8 #include "ui/app_list/app_list_switches.h" | 8 #include "ui/app_list/app_list_switches.h" |
9 #include "ui/app_list/pagination_model.h" | 9 #include "ui/app_list/pagination_model.h" |
10 #include "ui/app_list/presenter/app_list_presenter_delegate_factory.h" | 10 #include "ui/app_list/presenter/app_list_presenter_delegate_factory.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 layer->SetOpacity(is_visible_ ? 1.0 : 0.0); | 183 layer->SetOpacity(is_visible_ ? 1.0 : 0.0); |
184 widget->SetBounds(target_bounds); | 184 widget->SetBounds(target_bounds); |
185 } | 185 } |
186 | 186 |
187 int64_t AppListPresenterImpl::GetDisplayId() { | 187 int64_t AppListPresenterImpl::GetDisplayId() { |
188 views::Widget* widget = view_ ? view_->GetWidget() : nullptr; | 188 views::Widget* widget = view_ ? view_->GetWidget() : nullptr; |
189 if (!widget) | 189 if (!widget) |
190 return display::kInvalidDisplayId; | 190 return display::kInvalidDisplayId; |
191 return display::Screen::GetScreen() | 191 return display::Screen::GetScreen() |
192 ->GetDisplayNearestWindow(widget->GetNativeView()) | 192 ->GetDisplayNearestView(widget->GetNativeView()) |
193 .id(); | 193 .id(); |
194 } | 194 } |
195 | 195 |
196 //////////////////////////////////////////////////////////////////////////////// | 196 //////////////////////////////////////////////////////////////////////////////// |
197 // AppListPresenterImpl, aura::client::FocusChangeObserver implementation: | 197 // AppListPresenterImpl, aura::client::FocusChangeObserver implementation: |
198 | 198 |
199 void AppListPresenterImpl::OnWindowFocused(aura::Window* gained_focus, | 199 void AppListPresenterImpl::OnWindowFocused(aura::Window* gained_focus, |
200 aura::Window* lost_focus) { | 200 aura::Window* lost_focus) { |
201 if (view_ && is_visible_) { | 201 if (view_ && is_visible_) { |
202 aura::Window* applist_window = view_->GetWidget()->GetNativeView(); | 202 aura::Window* applist_window = view_->GetWidget()->GetNativeView(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } else if (should_snap_back_) { | 293 } else if (should_snap_back_) { |
294 should_snap_back_ = false; | 294 should_snap_back_ = false; |
295 ui::ScopedLayerAnimationSettings animation(widget_animator); | 295 ui::ScopedLayerAnimationSettings animation(widget_animator); |
296 animation.SetTransitionDuration( | 296 animation.SetTransitionDuration( |
297 base::TimeDelta::FromMilliseconds(kOverscrollPageTransitionDurationMs)); | 297 base::TimeDelta::FromMilliseconds(kOverscrollPageTransitionDurationMs)); |
298 widget->SetBounds(view_bounds_); | 298 widget->SetBounds(view_bounds_); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 } // namespace app_list | 302 } // namespace app_list |
OLD | NEW |