Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: ash/wm/dock/docked_window_layout_manager.h

Issue 1882713004: Only create DockedBackgroundWidget as needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a more verbose comment. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ 5 #ifndef ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_
6 #define ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ 6 #define ASH_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/shelf/shelf_layout_manager_observer.h"
12 #include "ash/shell_observer.h" 11 #include "ash/shell_observer.h"
13 #include "ash/snap_to_pixel_layout_manager.h" 12 #include "ash/snap_to_pixel_layout_manager.h"
14 #include "ash/wm/dock/dock_types.h" 13 #include "ash/wm/dock/dock_types.h"
15 #include "ash/wm/dock/docked_window_layout_manager_observer.h" 14 #include "ash/wm/dock/docked_window_layout_manager_observer.h"
16 #include "ash/wm/window_state_observer.h" 15 #include "ash/wm/window_state_observer.h"
17 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
18 #include "base/macros.h" 17 #include "base/macros.h"
19 #include "base/observer_list.h" 18 #include "base/observer_list.h"
20 #include "base/time/time.h" 19 #include "base/time/time.h"
21 #include "ui/aura/window.h" 20 #include "ui/aura/window.h"
(...skipping 12 matching lines...) Expand all
34 33
35 namespace views { 34 namespace views {
36 class Widget; 35 class Widget;
37 } 36 }
38 37
39 namespace ash { 38 namespace ash {
40 class DockedBackgroundWidget; 39 class DockedBackgroundWidget;
41 class DockedWindowLayoutManagerObserver; 40 class DockedWindowLayoutManagerObserver;
42 class DockedWindowResizerTest; 41 class DockedWindowResizerTest;
43 class Shelf; 42 class Shelf;
44 class ShelfLayoutManager;
45 class WorkspaceController; 43 class WorkspaceController;
46 44
47 struct WindowWithHeight { 45 struct WindowWithHeight {
48 explicit WindowWithHeight(aura::Window* window) : 46 explicit WindowWithHeight(aura::Window* window) :
49 window_(window), 47 window_(window),
50 height_(window->bounds().height()) { } 48 height_(window->bounds().height()) { }
51 aura::Window* window() { return window_; } 49 aura::Window* window() { return window_; }
52 const aura::Window* window() const { return window_; } 50 const aura::Window* window() const { return window_; }
53 aura::Window* window_; 51 aura::Window* window_;
54 int height_; 52 int height_;
(...skipping 10 matching lines...) Expand all
65 // new DockedWindowLayoutManager(dock_container)); 63 // new DockedWindowLayoutManager(dock_container));
66 // 64 //
67 // TODO(varkha): extend BaseLayoutManager instead of LayoutManager to inherit 65 // TODO(varkha): extend BaseLayoutManager instead of LayoutManager to inherit
68 // common functionality. 66 // common functionality.
69 class ASH_EXPORT DockedWindowLayoutManager 67 class ASH_EXPORT DockedWindowLayoutManager
70 : public SnapToPixelLayoutManager, 68 : public SnapToPixelLayoutManager,
71 public ash::ShellObserver, 69 public ash::ShellObserver,
72 public aura::WindowObserver, 70 public aura::WindowObserver,
73 public aura::client::ActivationChangeObserver, 71 public aura::client::ActivationChangeObserver,
74 public keyboard::KeyboardControllerObserver, 72 public keyboard::KeyboardControllerObserver,
75 public ShelfLayoutManagerObserver,
76 public wm::WindowStateObserver { 73 public wm::WindowStateObserver {
77 public: 74 public:
78 // Maximum width of the docked windows area. 75 // Maximum width of the docked windows area.
79 static const int kMaxDockWidth; 76 static const int kMaxDockWidth;
80 77
81 // Minimum width of the docked windows area. 78 // Minimum width of the docked windows area.
82 static const int kMinDockWidth; 79 static const int kMinDockWidth;
83 80
84 DockedWindowLayoutManager(aura::Window* dock_container, 81 DockedWindowLayoutManager(aura::Window* dock_container,
85 WorkspaceController* workspace_controller); 82 WorkspaceController* workspace_controller);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 bool visibile) override; 153 bool visibile) override;
157 void SetChildBounds(aura::Window* child, 154 void SetChildBounds(aura::Window* child,
158 const gfx::Rect& requested_bounds) override; 155 const gfx::Rect& requested_bounds) override;
159 156
160 // ash::ShellObserver: 157 // ash::ShellObserver:
161 void OnDisplayWorkAreaInsetsChanged() override; 158 void OnDisplayWorkAreaInsetsChanged() override;
162 void OnFullscreenStateChanged(bool is_fullscreen, 159 void OnFullscreenStateChanged(bool is_fullscreen,
163 aura::Window* root_window) override; 160 aura::Window* root_window) override;
164 void OnShelfAlignmentChanged(aura::Window* root_window) override; 161 void OnShelfAlignmentChanged(aura::Window* root_window) override;
165 162
166 // ShelfLayoutManagerObserver:
167 void OnBackgroundUpdated(ShelfBackgroundType background_type,
168 BackgroundAnimatorChangeType change_type) override;
169
170 // wm::WindowStateObserver: 163 // wm::WindowStateObserver:
171 void OnPreWindowStateTypeChange(wm::WindowState* window_state, 164 void OnPreWindowStateTypeChange(wm::WindowState* window_state,
172 wm::WindowStateType old_type) override; 165 wm::WindowStateType old_type) override;
173 166
174 // aura::WindowObserver: 167 // aura::WindowObserver:
175 void OnWindowBoundsChanged(aura::Window* window, 168 void OnWindowBoundsChanged(aura::Window* window,
176 const gfx::Rect& old_bounds, 169 const gfx::Rect& old_bounds,
177 const gfx::Rect& new_bounds) override; 170 const gfx::Rect& new_bounds) override;
178 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; 171 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override;
179 void OnWindowDestroying(aura::Window* window) override; 172 void OnWindowDestroying(aura::Window* window) override;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 320
328 // Observers of dock bounds changes. 321 // Observers of dock bounds changes.
329 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; 322 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_;
330 323
331 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); 324 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager);
332 }; 325 };
333 326
334 } // namespace ash 327 } // namespace ash
335 328
336 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ 329 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | ash/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698