| OLD | NEW | 
|    1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2013 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 #ifndef ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |    5 #ifndef ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 
|    6 #define ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |    6 #define ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 
|    7  |    7  | 
|    8 #include <memory> |    8 #include <memory> | 
|    9  |    9  | 
|   10 #include "ash/ash_export.h" |   10 #include "ash/ash_export.h" | 
|   11 #include "ash/common/shell_observer.h" |   11 #include "ash/common/shell_observer.h" | 
|   12 #include "ash/common/wm/dock/dock_types.h" |   12 #include "ash/common/wm/dock/dock_types.h" | 
|   13 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" |   13 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" | 
|   14 #include "ash/common/wm/window_state_observer.h" |   14 #include "ash/common/wm/window_state_observer.h" | 
|   15 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" |   15 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" | 
|   16 #include "ash/common/wm_activation_observer.h" |   16 #include "ash/common/wm_activation_observer.h" | 
|   17 #include "ash/common/wm_root_window_controller_observer.h" |  | 
|   18 #include "ash/common/wm_window_observer.h" |   17 #include "ash/common/wm_window_observer.h" | 
|   19 #include "base/compiler_specific.h" |   18 #include "base/compiler_specific.h" | 
|   20 #include "base/macros.h" |   19 #include "base/macros.h" | 
|   21 #include "base/observer_list.h" |   20 #include "base/observer_list.h" | 
|   22 #include "base/time/time.h" |   21 #include "base/time/time.h" | 
 |   22 #include "ui/display/display_observer.h" | 
|   23 #include "ui/gfx/geometry/rect.h" |   23 #include "ui/gfx/geometry/rect.h" | 
|   24 #include "ui/keyboard/keyboard_controller_observer.h" |   24 #include "ui/keyboard/keyboard_controller_observer.h" | 
|   25  |   25  | 
|   26 namespace ash { |   26 namespace ash { | 
|   27 class DockedBackgroundWidget; |   27 class DockedBackgroundWidget; | 
|   28 class DockedWindowLayoutManagerObserver; |   28 class DockedWindowLayoutManagerObserver; | 
|   29 class DockedWindowResizerTest; |   29 class DockedWindowResizerTest; | 
|   30 class Shelf; |   30 class Shelf; | 
|   31 class WmRootWindowController; |   31 class WmRootWindowController; | 
|   32 class WmShelf; |   32 class WmShelf; | 
|   33  |   33  | 
|   34 // DockedWindowLayoutManager is responsible for organizing windows when they are |   34 // DockedWindowLayoutManager is responsible for organizing windows when they are | 
|   35 // docked to the side of a screen. It is associated with a specific container |   35 // docked to the side of a screen. It is associated with a specific container | 
|   36 // window (i.e. kShellWindowId_DockedContainer) and controls the layout of any |   36 // window (i.e. kShellWindowId_DockedContainer) and controls the layout of any | 
|   37 // windows added to that container. |   37 // windows added to that container. | 
|   38 // |   38 // | 
|   39 // The constructor takes a |dock_container| argument which is expected to set |   39 // The constructor takes a |dock_container| argument which is expected to set | 
|   40 // its layout manager to this instance, e.g.: |   40 // its layout manager to this instance, e.g.: | 
|   41 // dock_container->SetLayoutManager( |   41 // dock_container->SetLayoutManager( | 
|   42 //     new DockedWindowLayoutManager(dock_container)); |   42 //     new DockedWindowLayoutManager(dock_container)); | 
|   43 // |   43 // | 
|   44 // TODO(varkha): extend BaseLayoutManager instead of LayoutManager to inherit |   44 // TODO(varkha): extend BaseLayoutManager instead of LayoutManager to inherit | 
|   45 // common functionality. |   45 // common functionality. | 
|   46 class ASH_EXPORT DockedWindowLayoutManager |   46 class ASH_EXPORT DockedWindowLayoutManager | 
|   47     : public wm::WmSnapToPixelLayoutManager, |   47     : public wm::WmSnapToPixelLayoutManager, | 
|   48       public WmRootWindowControllerObserver, |   48       public display::DisplayObserver, | 
|   49       public WmWindowObserver, |   49       public WmWindowObserver, | 
|   50       public WmActivationObserver, |   50       public WmActivationObserver, | 
|   51       public ShellObserver, |   51       public ShellObserver, | 
|   52       public keyboard::KeyboardControllerObserver, |   52       public keyboard::KeyboardControllerObserver, | 
|   53       public wm::WindowStateObserver { |   53       public wm::WindowStateObserver { | 
|   54  public: |   54  public: | 
|   55   // Maximum width of the docked windows area. |   55   // Maximum width of the docked windows area. | 
|   56   static const int kMaxDockWidth; |   56   static const int kMaxDockWidth; | 
|   57  |   57  | 
|   58   // Minimum width of the docked windows area. |   58   // Minimum width of the docked windows area. | 
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  129  |  129  | 
|  130   // SnapLayoutManager: |  130   // SnapLayoutManager: | 
|  131   void OnWindowResized() override; |  131   void OnWindowResized() override; | 
|  132   void OnWindowAddedToLayout(WmWindow* child) override; |  132   void OnWindowAddedToLayout(WmWindow* child) override; | 
|  133   void OnWillRemoveWindowFromLayout(WmWindow* child) override {} |  133   void OnWillRemoveWindowFromLayout(WmWindow* child) override {} | 
|  134   void OnWindowRemovedFromLayout(WmWindow* child) override; |  134   void OnWindowRemovedFromLayout(WmWindow* child) override; | 
|  135   void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; |  135   void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; | 
|  136   void SetChildBounds(WmWindow* child, |  136   void SetChildBounds(WmWindow* child, | 
|  137                       const gfx::Rect& requested_bounds) override; |  137                       const gfx::Rect& requested_bounds) override; | 
|  138  |  138  | 
|  139   // WmRootWindowControllerObserver: |  139   // display::DisplayObserver: | 
|  140   void OnWorkAreaChanged() override; |  140   void OnDisplayMetricsChanged(const display::Display& display, | 
|  141   void OnShelfAlignmentChanged() override; |  141                                uint32_t changed_metrics) override; | 
|  142  |  142  | 
|  143   // wm::WindowStateObserver: |  143   // wm::WindowStateObserver: | 
|  144   void OnPreWindowStateTypeChange(wm::WindowState* window_state, |  144   void OnPreWindowStateTypeChange(wm::WindowState* window_state, | 
|  145                                   wm::WindowStateType old_type) override; |  145                                   wm::WindowStateType old_type) override; | 
|  146  |  146  | 
|  147   // WmWindowObserver: |  147   // WmWindowObserver: | 
|  148   void OnWindowBoundsChanged(WmWindow* window, |  148   void OnWindowBoundsChanged(WmWindow* window, | 
|  149                              const gfx::Rect& old_bounds, |  149                              const gfx::Rect& old_bounds, | 
|  150                              const gfx::Rect& new_bounds) override; |  150                              const gfx::Rect& new_bounds) override; | 
|  151   void OnWindowVisibilityChanging(WmWindow* window, bool visible) override; |  151   void OnWindowVisibilityChanging(WmWindow* window, bool visible) override; | 
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  313  |  313  | 
|  314   // Observers of dock bounds changes. |  314   // Observers of dock bounds changes. | 
|  315   base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |  315   base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 
|  316  |  316  | 
|  317   DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |  317   DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 
|  318 }; |  318 }; | 
|  319  |  319  | 
|  320 }  // namespace ash |  320 }  // namespace ash | 
|  321  |  321  | 
|  322 #endif  // ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |  322 #endif  // ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 
| OLD | NEW |