Index: chrome/browser/ui/app_list/app_list_view_delegate.cc |
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc |
index e9c2a506db15c089ce73fac5ff2b413ec42bd218..4627efcc9648850013a6a5d499c8c4c6363f393a 100644 |
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc |
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc |
@@ -34,11 +34,16 @@ |
#include "content/public/browser/page_navigator.h" |
#include "content/public/browser/user_metrics.h" |
#include "grit/theme_resources.h" |
+#include "ui/app_list/app_list_switches.h" |
#include "ui/app_list/app_list_view_delegate_observer.h" |
#include "ui/app_list/search_box_model.h" |
#include "ui/app_list/speech_ui_model.h" |
#include "ui/base/resource/resource_bundle.h" |
+#if defined(USE_AURA) |
+#include "ui/keyboard/keyboard_util.h" |
+#endif |
+ |
#if defined(USE_ASH) |
#include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" |
#endif |
@@ -412,6 +417,21 @@ AppListViewDelegate::GetUsers() const { |
return users_; |
} |
+bool AppListViewDelegate::ShouldCenterWindow() const { |
+ if (app_list::switches::IsCenteredAppListEnabled()) |
+ return true; |
+ |
+ // keyboard depends upon Aura. |
+#if defined(USE_AURA) |
+ // If the virtual keyboard is enabled, use the new app list position. The old |
+ // position is too tall, and doesn't fit in the left-over screen space. |
+ if (keyboard::IsKeyboardEnabled()) |
+ return true; |
+#endif |
+ |
+ return false; |
+} |
+ |
void AppListViewDelegate::AddObserver( |
app_list::AppListViewDelegateObserver* observer) { |
observers_.AddObserver(observer); |