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

Side by Side Diff: ash/shelf/shelf_layout_manager.h

Issue 1812013003: Pass shelf instances, not root windows, for ash context menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call OnShelfAlignmentChanged after LayoutShelf. Created 4 years, 9 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 | « ash/shelf/shelf_alignment_menu.cc ('k') | ash/shelf/shelf_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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 explicit ShelfLayoutManager(ShelfWidget* shelf); 84 explicit ShelfLayoutManager(ShelfWidget* shelf);
85 ~ShelfLayoutManager() override; 85 ~ShelfLayoutManager() override;
86 86
87 // Sets the ShelfAutoHideBehavior. See enum description for details. 87 // Sets the ShelfAutoHideBehavior. See enum description for details.
88 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior); 88 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior);
89 ShelfAutoHideBehavior auto_hide_behavior() const { 89 ShelfAutoHideBehavior auto_hide_behavior() const {
90 return auto_hide_behavior_; 90 return auto_hide_behavior_;
91 } 91 }
92 92
93 // Sets the alignment. Returns true if the alignment got changed. If nothing 93 // Sets the alignment; changes are delayed if the screen is locked.
94 // has visually be changed, false will be returned. This can happen if either 94 void SetAlignment(ShelfAlignment alignment);
95 // the alignment was already set, or the shelf is currently locked and cannot
96 // be changed at this time. In the latter case the change will be performed
97 // once the shelf gets unlocked.
98 bool SetAlignment(ShelfAlignment alignment);
99 95
100 // Returns the desired alignment for the current state, either the user's 96 // Returns the desired alignment for the current state, either the user's
101 // set alignment (alignment_) or SHELF_ALIGNMENT_BOTTOM when the screen 97 // selected alignment or SHELF_ALIGNMENT_BOTTOM when the screen is locked.
102 // is locked.
103 ShelfAlignment GetAlignment() const; 98 ShelfAlignment GetAlignment() const;
104 99
105 void set_workspace_controller(WorkspaceController* controller) { 100 void set_workspace_controller(WorkspaceController* controller) {
106 workspace_controller_ = controller; 101 workspace_controller_ = controller;
107 } 102 }
108 103
109 bool updating_bounds() const { return updating_bounds_; } 104 bool updating_bounds() const { return updating_bounds_; }
110 105
111 // Clears internal data for shutdown process. 106 // Clears internal data for shutdown process.
112 void PrepareForShutdown(); 107 void PrepareForShutdown();
113 108
114 // Returns whether the shelf and its contents (shelf, status) are visible 109 // Returns whether the shelf and its contents (shelf, status) are visible
115 // on the screen. 110 // on the screen.
116 bool IsVisible() const; 111 bool IsVisible() const;
117 112
118 // Returns the ideal bounds of the shelf assuming it is visible. 113 // Returns the ideal bounds of the shelf assuming it is visible.
119 gfx::Rect GetIdealBounds(); 114 gfx::Rect GetIdealBounds();
120 115
121 // Returns the docked area bounds. 116 // Returns the docked area bounds.
122 const gfx::Rect& dock_bounds() const { return dock_bounds_; } 117 const gfx::Rect& dock_bounds() const { return dock_bounds_; }
123 118
124 // Returns the bounds within the root window not occupied by the shelf nor the 119 // Returns the bounds within the root window not occupied by the shelf nor the
125 // virtual keyboard. 120 // virtual keyboard.
126 const gfx::Rect& user_work_area_bounds() const { 121 const gfx::Rect& user_work_area_bounds() const {
127 return user_work_area_bounds_; 122 return user_work_area_bounds_;
128 } 123 }
129 124
130 // Stops any animations and sets the bounds of the shelf and status 125 // Stops any animations and sets the bounds of the shelf and status widgets.
131 // widgets.
132 void LayoutShelf(); 126 void LayoutShelf();
133 127
134 // Returns shelf visibility state based on current value of auto hide 128 // Returns shelf visibility state based on current value of auto hide
135 // behavior setting. 129 // behavior setting.
136 ShelfVisibilityState CalculateShelfVisibility(); 130 ShelfVisibilityState CalculateShelfVisibility();
137 131
138 // Updates the visibility state. 132 // Updates the visibility state.
139 void UpdateVisibilityState(); 133 void UpdateVisibilityState();
140 134
141 // Invoked by the shelf when the auto-hide state may have changed. 135 // Invoked by the shelf when the auto-hide state may have changed.
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 405
412 // The show hide animation duration override or 0 for default. 406 // The show hide animation duration override or 0 for default.
413 int duration_override_in_ms_; 407 int duration_override_in_ms_;
414 408
415 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); 409 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager);
416 }; 410 };
417 411
418 } // namespace ash 412 } // namespace ash
419 413
420 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ 414 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/shelf/shelf_alignment_menu.cc ('k') | ash/shelf/shelf_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698