Index: ash/shelf/shelf_layout_manager.cc |
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
index fce6b9e1f1eb1e4075ecf328f275b7ee004ee11b..3072989b57a5aa0e6c995e857178a5e2a8575ca6 100644 |
--- a/ash/shelf/shelf_layout_manager.cc |
+++ b/ash/shelf/shelf_layout_manager.cc |
@@ -25,6 +25,7 @@ |
#include "ash/system/status_area_widget.h" |
#include "ash/wm/gestures/shelf_gesture_handler.h" |
#include "ash/wm/lock_state_controller.h" |
+#include "ash/wm/maximize_mode/maximize_mode_controller.h" |
#include "ash/wm/mru_window_tracker.h" |
#include "ash/wm/window_animations.h" |
#include "ash/wm/window_state.h" |
@@ -32,7 +33,6 @@ |
#include "ash/wm/workspace_controller.h" |
#include "base/auto_reset.h" |
#include "base/command_line.h" |
-#include "base/command_line.h" |
#include "base/i18n/rtl.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/string_util.h" |
@@ -189,8 +189,6 @@ class ShelfLayoutManager::UpdateShelfObserver |
ShelfLayoutManager::ShelfLayoutManager(ShelfWidget* shelf) |
: root_window_(shelf->GetNativeView()->GetRootWindow()), |
updating_bounds_(false), |
- force_shelf_always_visibile_( |
- Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled()), |
auto_hide_behavior_(SHELF_AUTO_HIDE_BEHAVIOR_NEVER), |
alignment_(SHELF_ALIGNMENT_BOTTOM), |
shelf_(shelf), |
@@ -297,7 +295,7 @@ void ShelfLayoutManager::LayoutShelf() { |
} |
ShelfVisibilityState ShelfLayoutManager::CalculateShelfVisibility() { |
- switch(auto_hide_behavior_) { |
+ switch (auto_hide_behavior_) { |
jonross
2014/05/29 15:24:42
cpplint
|
case SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: |
return SHELF_AUTO_HIDE; |
case SHELF_AUTO_HIDE_BEHAVIOR_NEVER: |
@@ -562,17 +560,10 @@ void ShelfLayoutManager::OnLockStateChanged(bool locked) { |
} |
void ShelfLayoutManager::OnMaximizeModeStarted() { |
- DCHECK(!force_shelf_always_visibile_); |
- force_shelf_always_visibile_ = true; |
UpdateVisibilityState(); |
} |
void ShelfLayoutManager::OnMaximizeModeEnded() { |
- DCHECK(force_shelf_always_visibile_); |
- // Note: At this time Ash::Shell::IsMaximizeModeWindowManagerEnabled() will |
- // report true, even though it is in progress of shut down. To address this |
- // |force_shelf_always_visibile_| will be read. |
- force_shelf_always_visibile_ = false; |
UpdateVisibilityState(); |
} |
@@ -804,8 +795,8 @@ void ShelfLayoutManager::CalculateTargetBounds( |
else |
shelf_width = kAutoHideSize; |
} else if (state.visibility_state == SHELF_HIDDEN || |
- (!keyboard_bounds_.IsEmpty() && !keyboard::IsKeyboardOverscrollEnabled())) |
- { |
+ (!keyboard_bounds_.IsEmpty() && |
+ !keyboard::IsKeyboardOverscrollEnabled())) { |
jonross
2014/05/29 15:24:42
cpplint
flackr
2014/05/29 16:10:06
nit: This can be aligned with the above line (i.e.
jonross
2014/05/29 17:40:00
Done.
|
if (IsHorizontalAlignment()) |
shelf_height = 0; |
else |
@@ -1140,12 +1131,14 @@ int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { |
} |
bool ShelfLayoutManager::IsShelfForcedToBeVisible() const { |
+ bool force_shelf_always_visibile = Shell::GetInstance()-> |
+ maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled(); |
// Bail out early when there is no |workspace_controller_|, which happens |
// during shutdown after PrepareForShutdown. |
if (!workspace_controller_) |
- return force_shelf_always_visibile_; |
+ return force_shelf_always_visibile; |
- return force_shelf_always_visibile_ && |
+ return force_shelf_always_visibile && |
workspace_controller_->GetWindowState() != |
WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
} |