applist: Remove home launcher gesture flag.

Test: manual
Bug: 930219
Change-Id: Ia8d0d0d25996edd4c51f5eac758001fdbc3371c0
Reviewed-on: https://chromium-review.googlesource.com/c/1461194
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630830}
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc
index 2819bf9..2954c363 100644
--- a/ash/app_list/app_list_controller_impl.cc
+++ b/ash/app_list/app_list_controller_impl.cc
@@ -62,7 +62,9 @@
 }  // namespace
 
 AppListControllerImpl::AppListControllerImpl()
-    : presenter_(std::make_unique<AppListPresenterDelegateImpl>(this)) {
+    : presenter_(std::make_unique<AppListPresenterDelegateImpl>(this)),
+      home_launcher_gesture_handler_(
+          std::make_unique<HomeLauncherGestureHandler>(this)) {
   model_.AddObserver(this);
 
   SessionController* session_controller = Shell::Get()->session_controller();
@@ -77,12 +79,6 @@
   Shell::Get()->wallpaper_controller()->AddObserver(this);
   Shell::Get()->AddShellObserver(this);
   keyboard::KeyboardController::Get()->AddObserver(this);
-
-  if (app_list_features::IsHomeLauncherGesturesEnabled()) {
-    home_launcher_gesture_handler_ =
-        std::make_unique<HomeLauncherGestureHandler>(this);
-  }
-
   Shell::Get()->voice_interaction_controller()->AddLocalObserver(this);
   Shell::Get()->window_tree_host_manager()->AddObserver(this);
   Shell::Get()->mru_window_tracker()->AddObserver(this);
@@ -638,13 +634,8 @@
   if (!IsTabletMode())
     return ToggleAppList(display_id, show_source, event_time_stamp);
 
-  // Whether the this action is handled.
-  bool handled = false;
-
-  if (home_launcher_gesture_handler_) {
-    handled = home_launcher_gesture_handler_->ShowHomeLauncher(
-        Shell::Get()->display_manager()->GetDisplayForId(display_id));
-  }
+  bool handled = home_launcher_gesture_handler_->ShowHomeLauncher(
+      Shell::Get()->display_manager()->GetDisplayForId(display_id));
 
   if (!handled) {
     if (Shell::Get()->overview_controller()->IsSelecting()) {
@@ -852,9 +843,6 @@
 bool AppListControllerImpl::ProcessHomeLauncherGesture(
     ui::GestureEvent* event,
     const gfx::Point& screen_location) {
-  if (!home_launcher_gesture_handler_)
-    return false;
-
   switch (event->type()) {
     case ui::ET_SCROLL_FLING_START:
     case ui::ET_GESTURE_SCROLL_BEGIN:
@@ -882,9 +870,6 @@
     return false;
   }
 
-  if (!home_launcher_gesture_handler_)
-    return true;
-
   return home_launcher_gesture_handler_->mode() !=
          HomeLauncherGestureHandler::Mode::kSlideUpToShow;
 }
diff --git a/ash/app_list/views/contents_view.cc b/ash/app_list/views/contents_view.cc
index 1e3d4cee..9880fb3 100644
--- a/ash/app_list/views/contents_view.cc
+++ b/ash/app_list/views/contents_view.cc
@@ -365,14 +365,6 @@
 void ContentsView::UpdateExpandArrowOpacity(double progress,
                                             ash::AppListState current_state,
                                             ash::AppListState target_state) {
-  // Don't show |expand_arrow_view_| when the home launcher gestures are
-  // disabled in tablet mode.
-  if (app_list_view_->is_tablet_mode() &&
-      !app_list_features::IsHomeLauncherGesturesEnabled()) {
-    expand_arrow_view_->layer()->SetOpacity(0);
-    return;
-  }
-
   if (current_state == ash::AppListState::kStateSearchResults &&
       (target_state == ash::AppListState::kStateStart ||
        target_state == ash::AppListState::kStateApps)) {
diff --git a/ash/public/cpp/app_list/app_list_features.cc b/ash/public/cpp/app_list/app_list_features.cc
index b08bff2..5f50698 100644
--- a/ash/public/cpp/app_list/app_list_features.cc
+++ b/ash/public/cpp/app_list/app_list_features.cc
@@ -20,8 +20,6 @@
     "EnablePlayStoreAppSearch", base::FEATURE_DISABLED_BY_DEFAULT};
 const base::Feature kEnableAppDataSearch{"EnableAppDataSearch",
                                          base::FEATURE_DISABLED_BY_DEFAULT};
-const base::Feature kEnableHomeLauncherGestures{
-    "HomeLauncherGestures", base::FEATURE_ENABLED_BY_DEFAULT};
 const base::Feature kEnableSettingsShortcutSearch{
     "EnableSettingsShortcutSearch", base::FEATURE_DISABLED_BY_DEFAULT};
 const base::Feature kEnableZeroStateSuggestions{
@@ -57,10 +55,6 @@
   return base::FeatureList::IsEnabled(kEnableAppDataSearch);
 }
 
-bool IsHomeLauncherGesturesEnabled() {
-  return base::FeatureList::IsEnabled(kEnableHomeLauncherGestures);
-}
-
 bool IsSettingsShortcutSearchEnabled() {
   return base::FeatureList::IsEnabled(kEnableSettingsShortcutSearch);
 }
diff --git a/ash/public/cpp/app_list/app_list_features.h b/ash/public/cpp/app_list/app_list_features.h
index c69d435..2c192d4 100644
--- a/ash/public/cpp/app_list/app_list_features.h
+++ b/ash/public/cpp/app_list/app_list_features.h
@@ -35,10 +35,6 @@
 // Enables in-app data search.
 ASH_PUBLIC_EXPORT extern const base::Feature kEnableAppDataSearch;
 
-// Enables using gestures to show or hide the home launcher.
-// TODO(crbug.com/872319): Remove this after the feature is launched.
-ASH_PUBLIC_EXPORT extern const base::Feature kEnableHomeLauncherGestures;
-
 // Enables the Settings shortcut search.
 ASH_PUBLIC_EXPORT extern const base::Feature kEnableSettingsShortcutSearch;
 
@@ -63,7 +59,6 @@
 bool ASH_PUBLIC_EXPORT IsBackgroundBlurEnabled();
 bool ASH_PUBLIC_EXPORT IsPlayStoreAppSearchEnabled();
 bool ASH_PUBLIC_EXPORT IsAppDataSearchEnabled();
-bool ASH_PUBLIC_EXPORT IsHomeLauncherGesturesEnabled();
 bool ASH_PUBLIC_EXPORT IsSettingsShortcutSearchEnabled();
 bool ASH_PUBLIC_EXPORT IsZeroStateSuggestionsEnabled();
 bool ASH_PUBLIC_EXPORT IsAppListSearchAutocompleteEnabled();
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index af81f82..5a59daf 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -1260,13 +1260,6 @@
 }
 
 bool ShelfLayoutManager::ShouldHomeGestureHandleEvent(float scroll_y) const {
-  HomeLauncherGestureHandler* home_launcher_handler =
-      Shell::Get()->app_list_controller()->home_launcher_gesture_handler();
-
-  // If there is no |home_launcher_handler|, return early.
-  if (!home_launcher_handler)
-    return false;
-
   // If the shelf is not visible, home gesture shouldn't trigger.
   if (!IsVisible())
     return false;
@@ -1399,8 +1392,8 @@
 
   HomeLauncherGestureHandler* home_launcher_handler =
       Shell::Get()->app_list_controller()->home_launcher_gesture_handler();
-  if (home_launcher_handler &&
-      home_launcher_handler->OnReleaseEvent(gesture_in_screen.location())) {
+  DCHECK(home_launcher_handler);
+  if (home_launcher_handler->OnReleaseEvent(gesture_in_screen.location())) {
     gesture_drag_status_ = GESTURE_DRAG_NONE;
     return;
   }
@@ -1449,7 +1442,8 @@
   if (gesture_drag_status_ == GESTURE_DRAG_APPLIST_IN_PROGRESS) {
     HomeLauncherGestureHandler* home_launcher_handler =
         Shell::Get()->app_list_controller()->home_launcher_gesture_handler();
-    if (home_launcher_handler && home_launcher_handler->IsDragInProgress())
+    DCHECK(home_launcher_handler);
+    if (home_launcher_handler->IsDragInProgress())
       home_launcher_handler->Cancel();
     else
       Shell::Get()->app_list_controller()->DismissAppList();
diff --git a/ash/wm/overview/overview_utils.cc b/ash/wm/overview/overview_utils.cc
index 84cd18b3..2f42102 100644
--- a/ash/wm/overview/overview_utils.cc
+++ b/ash/wm/overview/overview_utils.cc
@@ -293,11 +293,10 @@
   if (!Shell::Get()->overview_controller()->IsSelecting())
     return false;
 
-  HomeLauncherGestureHandler* home_launcher_gesture_handler =
-      Shell::Get()->app_list_controller()->home_launcher_gesture_handler();
-  if (home_launcher_gesture_handler &&
-      home_launcher_gesture_handler->mode() ==
-          HomeLauncherGestureHandler::Mode::kSlideUpToShow) {
+  if (Shell::Get()
+          ->app_list_controller()
+          ->home_launcher_gesture_handler()
+          ->mode() == HomeLauncherGestureHandler::Mode::kSlideUpToShow) {
     return true;
   }
 
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 1073ba2..c39994d 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4012,12 +4012,8 @@
      flag_descriptions::kVaapiJpegImageDecodeAccelerationName,
      flag_descriptions::kVaapiJpegImageDecodeAccelerationDescription, kOsCrOS,
      FEATURE_VALUE_TYPE(features::kVaapiJpegImageDecodeAcceleration)},
-
-    {"enable-home-launcher-gestures",
-     flag_descriptions::kEnableHomeLauncherGesturesName,
-     flag_descriptions::kEnableHomeLauncherGesturesDescription, kOsCrOS,
-     FEATURE_VALUE_TYPE(app_list_features::kEnableHomeLauncherGestures)},
 #endif
+
 #if defined(OS_WIN)
     {"calculate-native-win-occlusion",
      flag_descriptions::kCalculateNativeWinOcclusionName,
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 7f1048e..c2cbc5b 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1288,11 +1288,6 @@
     "expiry_milestone": 76
   },
   {
-    "name": "enable-home-launcher-gestures",
-    // "owners": [ "your-team" ],
-    "expiry_milestone": 76
-  },
-  {
     "name": "enable-homepage-tile",
     // "owners": [ "your-team" ],
     "expiry_milestone": 76
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index acdd1b7..4870a63 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -3311,10 +3311,6 @@
 const char kEnableHomeLauncherDescription[] =
     "Enable home launcher in tablet mode.";
 
-const char kEnableHomeLauncherGesturesName[] = "Enable home launcher gestures";
-const char kEnableHomeLauncherGesturesDescription[] =
-    "Enables using gestures to hide or show the home launcher.";
-
 const char kEnableImeMenuName[] = "Enable opt-in IME menu";
 const char kEnableImeMenuDescription[] =
     "Enable access to the new IME menu in the Language Settings page.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 8c579f4c..e3535c7 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1985,9 +1985,6 @@
 extern const char kEnableHomeLauncherName[];
 extern const char kEnableHomeLauncherDescription[];
 
-extern const char kEnableHomeLauncherGesturesName[];
-extern const char kEnableHomeLauncherGesturesDescription[];
-
 extern const char kEnableImeMenuName[];
 extern const char kEnableImeMenuDescription[];