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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 2266183002: ash: Remove unnecessary checks for null ShelfWidget in ShelfLayoutManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 4d37d8ffe80694c3ca256893675032ed1ae4ecc0..83715d8c8a555e98f297fc61b67b75b72bbce099 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -157,6 +157,7 @@ ShelfLayoutManager::ShelfLayoutManager(ShelfWidget* shelf_widget)
duration_override_in_ms_(0),
root_window_controller_observer_(
new RootWindowControllerObserverImpl(this)) {
+ DCHECK(shelf_widget_);
WmShell::Get()->AddShellObserver(this);
WmShell::Get()->AddLockStateObserver(this);
WmShell::Get()->AddActivationObserver(this);
@@ -884,8 +885,7 @@ gfx::Rect ShelfLayoutManager::GetAutoHideShowShelfRegionInScreen() const {
ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState(
ShelfVisibilityState visibility_state) const {
- if (visibility_state != SHELF_AUTO_HIDE || !shelf_widget_ ||
- !shelf_widget_->shelf())
+ if (visibility_state != SHELF_AUTO_HIDE || !shelf_widget_->shelf())
return SHELF_AUTO_HIDE_HIDDEN;
const int64_t shelf_display_id = WmLookup::Get()
@@ -987,7 +987,7 @@ ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState(
}
bool ShelfLayoutManager::IsShelfWindow(WmWindow* window) {
- if (!window || !shelf_widget_)
+ if (!window)
return false;
WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(shelf_widget_);
WmWindow* status_window =
@@ -1145,10 +1145,10 @@ void ShelfLayoutManager::CompleteGestureDrag(const ui::GestureEvent& gesture) {
CancelGestureDrag();
return;
}
- if (shelf_widget_) {
- shelf_widget_->Deactivate();
- shelf_widget_->status_area_widget()->Deactivate();
- }
+
+ shelf_widget_->Deactivate();
+ shelf_widget_->status_area_widget()->Deactivate();
+
gesture_drag_auto_hide_state_ =
gesture_drag_auto_hide_state_ == SHELF_AUTO_HIDE_SHOWN
? SHELF_AUTO_HIDE_HIDDEN
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698