| 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/shelf/shelf_layout_manager.h" |     5 #include "ash/shelf/shelf_layout_manager.h" | 
|     6  |     6  | 
|     7 #include <algorithm> |     7 #include <algorithm> | 
|     8 #include <cmath> |     8 #include <cmath> | 
|     9 #include <vector> |     9 #include <vector> | 
|    10  |    10  | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
|    21 #include "ash/shell.h" |    21 #include "ash/shell.h" | 
|    22 #include "ash/shell_port.h" |    22 #include "ash/shell_port.h" | 
|    23 #include "ash/system/status_area_widget.h" |    23 #include "ash/system/status_area_widget.h" | 
|    24 #include "ash/wm/fullscreen_window_finder.h" |    24 #include "ash/wm/fullscreen_window_finder.h" | 
|    25 #include "ash/wm/mru_window_tracker.h" |    25 #include "ash/wm/mru_window_tracker.h" | 
|    26 #include "ash/wm/screen_pinning_controller.h" |    26 #include "ash/wm/screen_pinning_controller.h" | 
|    27 #include "ash/wm/window_state.h" |    27 #include "ash/wm/window_state.h" | 
|    28 #include "base/auto_reset.h" |    28 #include "base/auto_reset.h" | 
|    29 #include "base/command_line.h" |    29 #include "base/command_line.h" | 
|    30 #include "base/i18n/rtl.h" |    30 #include "base/i18n/rtl.h" | 
|    31 #include "ui/app_list/app_list_features.h" |  | 
|    32 #include "ui/base/ui_base_switches.h" |    31 #include "ui/base/ui_base_switches.h" | 
|    33 #include "ui/compositor/layer.h" |    32 #include "ui/compositor/layer.h" | 
|    34 #include "ui/compositor/layer_animation_observer.h" |    33 #include "ui/compositor/layer_animation_observer.h" | 
|    35 #include "ui/compositor/layer_animator.h" |    34 #include "ui/compositor/layer_animator.h" | 
|    36 #include "ui/compositor/scoped_layer_animation_settings.h" |    35 #include "ui/compositor/scoped_layer_animation_settings.h" | 
|    37 #include "ui/display/display.h" |    36 #include "ui/display/display.h" | 
|    38 #include "ui/display/screen.h" |    37 #include "ui/display/screen.h" | 
|    39 #include "ui/events/event.h" |    38 #include "ui/events/event.h" | 
|    40 #include "ui/events/event_handler.h" |    39 #include "ui/events/event_handler.h" | 
|    41 #include "ui/keyboard/keyboard_controller.h" |    40 #include "ui/keyboard/keyboard_controller.h" | 
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   419 } |   418 } | 
|   420  |   419  | 
|   421 void ShelfLayoutManager::OnVirtualKeyboardStateChanged( |   420 void ShelfLayoutManager::OnVirtualKeyboardStateChanged( | 
|   422     bool activated, |   421     bool activated, | 
|   423     aura::Window* root_window) { |   422     aura::Window* root_window) { | 
|   424   UpdateKeyboardObserverFromStateChanged( |   423   UpdateKeyboardObserverFromStateChanged( | 
|   425       activated, root_window, shelf_widget_->GetNativeWindow()->GetRootWindow(), |   424       activated, root_window, shelf_widget_->GetNativeWindow()->GetRootWindow(), | 
|   426       &keyboard_observer_); |   425       &keyboard_observer_); | 
|   427 } |   426 } | 
|   428  |   427  | 
|   429 void ShelfLayoutManager::OnAppListVisibilityChanged(bool shown, |  | 
|   430                                                     aura::Window* root_window) { |  | 
|   431   if (shelf_ != Shelf::ForWindow(root_window)) |  | 
|   432     return; |  | 
|   433  |  | 
|   434   is_app_list_visible_ = shown; |  | 
|   435   if (app_list::features::IsFullscreenAppListEnabled()) |  | 
|   436     MaybeUpdateShelfBackground(AnimationChangeType::IMMEDIATE); |  | 
|   437 } |  | 
|   438  |  | 
|   439 void ShelfLayoutManager::OnWindowActivated(ActivationReason reason, |   428 void ShelfLayoutManager::OnWindowActivated(ActivationReason reason, | 
|   440                                            aura::Window* gained_active, |   429                                            aura::Window* gained_active, | 
|   441                                            aura::Window* lost_active) { |   430                                            aura::Window* lost_active) { | 
|   442   UpdateAutoHideStateNow(); |   431   UpdateAutoHideStateNow(); | 
|   443 } |   432 } | 
|   444  |   433  | 
|   445 void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { |   434 void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { | 
|   446   bool keyboard_is_about_to_hide = false; |   435   bool keyboard_is_about_to_hide = false; | 
|   447   if (new_bounds.IsEmpty() && !keyboard_bounds_.IsEmpty()) |   436   if (new_bounds.IsEmpty() && !keyboard_bounds_.IsEmpty()) | 
|   448     keyboard_is_about_to_hide = true; |   437     keyboard_is_about_to_hide = true; | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
|   472 } |   461 } | 
|   473  |   462  | 
|   474 ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const { |   463 ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const { | 
|   475   if (state_.pre_lock_screen_animation_active) |   464   if (state_.pre_lock_screen_animation_active) | 
|   476     return SHELF_BACKGROUND_DEFAULT; |   465     return SHELF_BACKGROUND_DEFAULT; | 
|   477  |   466  | 
|   478   // Handle all non active screen states, including OOBE and pre-login. |   467   // Handle all non active screen states, including OOBE and pre-login. | 
|   479   if (state_.session_state != session_manager::SessionState::ACTIVE) |   468   if (state_.session_state != session_manager::SessionState::ACTIVE) | 
|   480     return SHELF_BACKGROUND_OVERLAP; |   469     return SHELF_BACKGROUND_OVERLAP; | 
|   481  |   470  | 
|   482   // If the app list is active, hide the shelf background to prevent overlap. |  | 
|   483   if (is_app_list_visible_ && app_list::features::IsFullscreenAppListEnabled()) |  | 
|   484     return SHELF_BACKGROUND_DEFAULT; |  | 
|   485  |  | 
|   486   if (state_.visibility_state != SHELF_AUTO_HIDE && |   471   if (state_.visibility_state != SHELF_AUTO_HIDE && | 
|   487       state_.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED) { |   472       state_.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED) { | 
|   488     return SHELF_BACKGROUND_MAXIMIZED; |   473     return SHELF_BACKGROUND_MAXIMIZED; | 
|   489   } |   474   } | 
|   490  |   475  | 
|   491   if (gesture_drag_status_ == GESTURE_DRAG_IN_PROGRESS || |   476   if (gesture_drag_status_ == GESTURE_DRAG_IN_PROGRESS || | 
|   492       window_overlaps_shelf_ || state_.visibility_state == SHELF_AUTO_HIDE) { |   477       window_overlaps_shelf_ || state_.visibility_state == SHELF_AUTO_HIDE) { | 
|   493     return SHELF_BACKGROUND_OVERLAP; |   478     return SHELF_BACKGROUND_OVERLAP; | 
|   494   } |   479   } | 
|   495  |   480  | 
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1163       return gesture_drag_amount_ < 0; |  1148       return gesture_drag_amount_ < 0; | 
|  1164     case SHELF_ALIGNMENT_LEFT: |  1149     case SHELF_ALIGNMENT_LEFT: | 
|  1165       if (gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_SHOWN) |  1150       if (gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_SHOWN) | 
|  1166         return gesture_drag_amount_ < 0; |  1151         return gesture_drag_amount_ < 0; | 
|  1167       return gesture_drag_amount_ > 0; |  1152       return gesture_drag_amount_ > 0; | 
|  1168   } |  1153   } | 
|  1169   return false; |  1154   return false; | 
|  1170 } |  1155 } | 
|  1171  |  1156  | 
|  1172 }  // namespace ash |  1157 }  // namespace ash | 
| OLD | NEW |