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

Unified Diff: ash/common/shelf/shelf_widget.cc

Issue 2534953006: Fix shelf auto-hide calculation for app-list visibility. (Closed)
Patch Set: Address comments. Created 4 years 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 | « ash/common/shelf/shelf_widget.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_widget.cc
diff --git a/ash/common/shelf/shelf_widget.cc b/ash/common/shelf/shelf_widget.cc
index 187e3d20f67f23683df32e9b91192e33f6f4f81e..3c4b94750d8462049d876c6cc028bcb26639ece9 100644
--- a/ash/common/shelf/shelf_widget.cc
+++ b/ash/common/shelf/shelf_widget.cc
@@ -7,6 +7,7 @@
#include "ash/common/focus_cycler.h"
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/shelf/app_list_button.h"
#include "ash/common/shelf/shelf_background_animator_observer.h"
#include "ash/common/shelf/shelf_constants.h"
#include "ash/common/shelf/shelf_delegate.h"
@@ -433,6 +434,10 @@ void ShelfWidget::SetShelfVisibility(bool visible) {
shelf_view_->SetVisible(visible);
}
+bool ShelfWidget::IsShowingAppList() const {
+ return GetAppListButton() && GetAppListButton()->is_showing_app_list();
+}
+
bool ShelfWidget::IsShowingContextMenu() const {
return shelf_view_ && shelf_view_->IsShowingMenu();
}
@@ -496,7 +501,7 @@ gfx::Rect ShelfWidget::GetScreenBoundsOfItemIconForWindow(WmWindow* window) {
}
AppListButton* ShelfWidget::GetAppListButton() const {
- return shelf_view_->GetAppListButton();
+ return shelf_view_ ? shelf_view_->GetAppListButton() : nullptr;
}
app_list::ApplicationDragAndDropHost*
« no previous file with comments | « ash/common/shelf/shelf_widget.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698