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 #ifndef ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
6 #define ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 6 #define ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "ash/shelf/background_animator.h" | 11 #include "ash/shelf/background_animator.h" |
12 #include "ash/shelf/shelf.h" | 12 #include "ash/shelf/shelf.h" |
13 #include "ash/shelf/shelf_types.h" | 13 #include "ash/shelf/shelf_types.h" |
14 #include "ash/shell_observer.h" | 14 #include "ash/shell_observer.h" |
15 #include "ash/system/status_area_widget.h" | 15 #include "ash/system/status_area_widget.h" |
16 #include "ash/wm/dock/docked_window_layout_manager_observer.h" | 16 #include "ash/wm/dock/docked_window_layout_manager_observer.h" |
17 #include "ash/wm/lock_state_observer.h" | 17 #include "ash/wm/lock_state_observer.h" |
18 #include "ash/wm/workspace/workspace_types.h" | 18 #include "ash/wm/workspace/workspace_types.h" |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/compiler_specific.h" | 20 #include "base/compiler_specific.h" |
21 #include "base/logging.h" | 21 #include "base/logging.h" |
22 #include "base/observer_list.h" | 22 #include "base/observer_list.h" |
23 #include "base/timer/timer.h" | 23 #include "base/timer/timer.h" |
| 24 #include "ui/aura/client/virtual_keyboard_observer.h" |
24 #include "ui/aura/layout_manager.h" | 25 #include "ui/aura/layout_manager.h" |
25 #include "ui/gfx/insets.h" | 26 #include "ui/gfx/insets.h" |
26 #include "ui/gfx/rect.h" | 27 #include "ui/gfx/rect.h" |
27 #include "ui/keyboard/keyboard_controller.h" | 28 #include "ui/keyboard/keyboard_controller.h" |
28 #include "ui/keyboard/keyboard_controller_observer.h" | |
29 #include "ui/wm/public/activation_change_observer.h" | 29 #include "ui/wm/public/activation_change_observer.h" |
30 | 30 |
31 namespace aura { | 31 namespace aura { |
32 class RootWindow; | 32 class RootWindow; |
33 } | 33 } |
34 | 34 |
35 namespace ui { | 35 namespace ui { |
36 class GestureEvent; | 36 class GestureEvent; |
37 class ImplicitAnimationObserver; | 37 class ImplicitAnimationObserver; |
38 } | 38 } |
(...skipping 15 matching lines...) Expand all Loading... |
54 // ShelfLayoutManager is the layout manager responsible for the shelf and | 54 // ShelfLayoutManager is the layout manager responsible for the shelf and |
55 // status widgets. The shelf is given the total available width and told the | 55 // status widgets. The shelf is given the total available width and told the |
56 // width of the status area. This allows the shelf to draw the background and | 56 // width of the status area. This allows the shelf to draw the background and |
57 // layout to the status area. | 57 // layout to the status area. |
58 // To respond to bounds changes in the status area StatusAreaLayoutManager works | 58 // To respond to bounds changes in the status area StatusAreaLayoutManager works |
59 // closely with ShelfLayoutManager. | 59 // closely with ShelfLayoutManager. |
60 class ASH_EXPORT ShelfLayoutManager : | 60 class ASH_EXPORT ShelfLayoutManager : |
61 public aura::LayoutManager, | 61 public aura::LayoutManager, |
62 public ash::ShellObserver, | 62 public ash::ShellObserver, |
63 public aura::client::ActivationChangeObserver, | 63 public aura::client::ActivationChangeObserver, |
| 64 public aura::client::VirtualKeyboardObserver, |
64 public DockedWindowLayoutManagerObserver, | 65 public DockedWindowLayoutManagerObserver, |
65 public keyboard::KeyboardControllerObserver, | |
66 public LockStateObserver { | 66 public LockStateObserver { |
67 public: | 67 public: |
68 | 68 |
69 // We reserve a small area on the edge of the workspace area to ensure that | 69 // We reserve a small area on the edge of the workspace area to ensure that |
70 // the resize handle at the edge of the window can be hit. | 70 // the resize handle at the edge of the window can be hit. |
71 static const int kWorkspaceAreaVisibleInset; | 71 static const int kWorkspaceAreaVisibleInset; |
72 | 72 |
73 // When autohidden we extend the touch hit target onto the screen so that the | 73 // When autohidden we extend the touch hit target onto the screen so that the |
74 // user can drag the shelf out. | 74 // user can drag the shelf out. |
75 static const int kWorkspaceAreaAutoHideInset; | 75 static const int kWorkspaceAreaAutoHideInset; |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 323 |
324 // Returns true if |window| is a descendant of the shelf. | 324 // Returns true if |window| is a descendant of the shelf. |
325 bool IsShelfWindow(aura::Window* window); | 325 bool IsShelfWindow(aura::Window* window); |
326 | 326 |
327 int GetWorkAreaSize(const State& state, int size) const; | 327 int GetWorkAreaSize(const State& state, int size) const; |
328 | 328 |
329 // Return the bounds available in the parent, taking into account the bounds | 329 // Return the bounds available in the parent, taking into account the bounds |
330 // of the keyboard if necessary. | 330 // of the keyboard if necessary. |
331 gfx::Rect GetAvailableBounds() const; | 331 gfx::Rect GetAvailableBounds() const; |
332 | 332 |
333 // Overridden from keyboard::KeyboardControllerObserver: | 333 // Overridden from aura::client::VirtualKeyboardObserver: |
334 virtual void OnKeyboardBoundsChanging( | 334 virtual void OnKeyboardBoundsChanging( |
335 const gfx::Rect& keyboard_bounds) OVERRIDE; | 335 const gfx::Rect& keyboard_bounds) OVERRIDE; |
336 | 336 |
337 // Overridden from DockedWindowLayoutManagerObserver: | 337 // Overridden from DockedWindowLayoutManagerObserver: |
338 virtual void OnDockBoundsChanging( | 338 virtual void OnDockBoundsChanging( |
339 const gfx::Rect& dock_bounds, | 339 const gfx::Rect& dock_bounds, |
340 DockedWindowLayoutManagerObserver::Reason reason) OVERRIDE; | 340 DockedWindowLayoutManagerObserver::Reason reason) OVERRIDE; |
341 | 341 |
342 // The RootWindow is cached so that we don't invoke Shell::GetInstance() from | 342 // The RootWindow is cached so that we don't invoke Shell::GetInstance() from |
343 // our destructor. We avoid that as at the time we're deleted Shell is being | 343 // our destructor. We avoid that as at the time we're deleted Shell is being |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // The show hide animation duration override or 0 for default. | 414 // The show hide animation duration override or 0 for default. |
415 int duration_override_in_ms_; | 415 int duration_override_in_ms_; |
416 | 416 |
417 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 417 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
418 }; | 418 }; |
419 | 419 |
420 } // namespace internal | 420 } // namespace internal |
421 } // namespace ash | 421 } // namespace ash |
422 | 422 |
423 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 423 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
OLD | NEW |