CrOS Shelf: Rename AppListButton --> HomeButton
This change was created mostly with the help of sed and mv :-)
Bug: 973443
Change-Id: Id7c15d67e7be3ec20859fa26f43ad88145a16b96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679163
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672795}
diff --git a/ash/BUILD.gn b/ash/BUILD.gn
index aad4a3e..37937f2 100644
--- a/ash/BUILD.gn
+++ b/ash/BUILD.gn
@@ -517,16 +517,16 @@
"session/session_observer.h",
"session/teleport_warning_dialog.cc",
"session/teleport_warning_dialog.h",
- "shelf/app_list_button.cc",
- "shelf/app_list_button.h",
- "shelf/app_list_button_controller.cc",
- "shelf/app_list_button_controller.h",
"shelf/assistant_overlay.cc",
"shelf/assistant_overlay.h",
"shelf/back_button.cc",
"shelf/back_button.h",
"shelf/default_shelf_view.cc",
"shelf/default_shelf_view.h",
+ "shelf/home_button.cc",
+ "shelf/home_button.h",
+ "shelf/home_button_controller.cc",
+ "shelf/home_button_controller.h",
"shelf/ink_drop_button_listener.h",
"shelf/kiosk_next_shelf_view.cc",
"shelf/kiosk_next_shelf_view.h",
@@ -1695,8 +1695,8 @@
"rotator/screen_rotation_animator_unittest.cc",
"screen_util_unittest.cc",
"session/session_controller_impl_unittest.cc",
- "shelf/app_list_button_unittest.cc",
"shelf/back_button_unittest.cc",
+ "shelf/home_button_unittest.cc",
"shelf/login_shelf_view_unittest.cc",
"shelf/shelf_application_menu_model_unittest.cc",
"shelf/shelf_background_animator_unittest.cc",
diff --git a/ash/accelerators/accelerator_controller_impl.cc b/ash/accelerators/accelerator_controller_impl.cc
index 8781c8a1..3536eb46 100644
--- a/ash/accelerators/accelerator_controller_impl.cc
+++ b/ash/accelerators/accelerator_controller_impl.cc
@@ -43,7 +43,7 @@
#include "ash/root_window_controller.h"
#include "ash/rotator/window_rotation.h"
#include "ash/session/session_controller_impl.h"
-#include "ash/shelf/app_list_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
@@ -549,7 +549,7 @@
Shelf::ForWindow(Shell::GetRootWindowForNewWindows())
->shelf_widget()
- ->GetAppListButton()
+ ->GetHomeButton()
->OnPressed(show_source, accelerator.time_stamp());
}
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc
index 2ba29ce..0b595d24 100644
--- a/ash/app_list/app_list_controller_impl.cc
+++ b/ash/app_list/app_list_controller_impl.cc
@@ -84,7 +84,7 @@
return app_list::TabletModeAnimationTransition::
kHideHomeLauncherForWindow;
case HomeScreenDelegate::AnimationTrigger::kLauncherButton:
- return app_list::TabletModeAnimationTransition::kAppListButtonShow;
+ return app_list::TabletModeAnimationTransition::kHomeButtonShow;
case HomeScreenDelegate::AnimationTrigger::kDragRelease:
return launcher_should_show
? app_list::TabletModeAnimationTransition::kDragReleaseShow
@@ -809,7 +809,7 @@
focused_view->SchedulePaint();
}
-ash::ShelfAction AppListControllerImpl::OnAppListButtonPressed(
+ash::ShelfAction AppListControllerImpl::OnHomeButtonPressed(
int64_t display_id,
app_list::AppListShowSource show_source,
base::TimeTicks event_time_stamp) {
diff --git a/ash/app_list/app_list_controller_impl.h b/ash/app_list/app_list_controller_impl.h
index 1a41e1e..c1fcdfe 100644
--- a/ash/app_list/app_list_controller_impl.h
+++ b/ash/app_list/app_list_controller_impl.h
@@ -278,15 +278,14 @@
void SetKeyboardTraversalMode(bool engaged);
- // Handles app list button press event. (Search key should trigger the same
+ // Handles home button press event. (Search key should trigger the same
// behavior.) All three parameters are only used in clamshell mode.
// |display_id| is the id of display where app list should toggle.
// |show_source| is the source of the event. |event_time_stamp| records the
// event timestamp.
- ash::ShelfAction OnAppListButtonPressed(
- int64_t display_id,
- app_list::AppListShowSource show_source,
- base::TimeTicks event_time_stamp);
+ ash::ShelfAction OnHomeButtonPressed(int64_t display_id,
+ app_list::AppListShowSource show_source,
+ base::TimeTicks event_time_stamp);
// Returns current visibility of the Assistant page.
bool IsShowingEmbeddedAssistantUI() const;
diff --git a/ash/app_list/app_list_metrics.h b/ash/app_list/app_list_metrics.h
index caa3941..293a540 100644
--- a/ash/app_list/app_list_metrics.h
+++ b/ash/app_list/app_list_metrics.h
@@ -235,8 +235,8 @@
// Release drag to hide the launcher (launcher animates the rest of the way).
kDragReleaseHide,
- // Click the AppList button in tablet mode.
- kAppListButtonShow,
+ // Click the Home button in tablet mode.
+ kHomeButtonShow,
// Activate a window from shelf to hide the launcher in tablet mode.
kHideHomeLauncherForWindow,
diff --git a/ash/app_list/app_list_presenter_delegate_impl.cc b/ash/app_list/app_list_presenter_delegate_impl.cc
index 9bccc60..b406415 100644
--- a/ash/app_list/app_list_presenter_delegate_impl.cc
+++ b/ash/app_list/app_list_presenter_delegate_impl.cc
@@ -18,8 +18,8 @@
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
-#include "ash/shelf/app_list_button.h"
#include "ash/shelf/back_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_widget.h"
@@ -178,13 +178,13 @@
return;
}
- // If the event happened on the app list button, it'll get handled by the
+ // If the event happened on the home button, it'll get handled by the
// button.
Shelf* shelf = Shelf::ForWindow(target);
- AppListButton* app_list_button = shelf->shelf_widget()->GetAppListButton();
- if (app_list_button && app_list_button->GetWidget() &&
- target == app_list_button->GetWidget()->GetNativeWindow() &&
- app_list_button->bounds().Contains(event->location())) {
+ HomeButton* home_button = shelf->shelf_widget()->GetHomeButton();
+ if (home_button && home_button->GetWidget() &&
+ target == home_button->GetWidget()->GetNativeWindow() &&
+ home_button->bounds().Contains(event->location())) {
return;
}
diff --git a/ash/app_list/app_list_presenter_delegate_unittest.cc b/ash/app_list/app_list_presenter_delegate_unittest.cc
index 9e53666..f632fa1 100644
--- a/ash/app_list/app_list_presenter_delegate_unittest.cc
+++ b/ash/app_list/app_list_presenter_delegate_unittest.cc
@@ -1385,8 +1385,8 @@
GetAppListTestHelper()->WaitUntilIdle();
}
- void PressAppListButton() {
- Shell::Get()->app_list_controller()->OnAppListButtonPressed(
+ void PressHomeButton() {
+ Shell::Get()->app_list_controller()->OnHomeButtonPressed(
GetPrimaryDisplayId(), app_list::AppListShowSource::kShelfButton,
base::TimeTicks());
GetAppListTestHelper()->WaitUntilIdle();
@@ -1762,9 +1762,8 @@
GetAppListTestHelper()->CheckVisibility(true);
}
-// Tests that the app list button will minimize all windows.
-TEST_F(AppListPresenterDelegateHomeLauncherTest,
- AppListButtonMinimizeAllWindows) {
+// Tests that the home button will minimize all windows.
+TEST_F(AppListPresenterDelegateHomeLauncherTest, HomeButtonMinimizeAllWindows) {
// Show app list in tablet mode. Maximize all windows.
EnableTabletMode(true);
GetAppListTestHelper()->CheckVisibility(true);
@@ -1788,8 +1787,8 @@
auto ordering =
Shell::Get()->mru_window_tracker()->BuildWindowForCycleList(kActiveDesk);
- // Press app list button.
- PressAppListButton();
+ // Press home button.
+ PressHomeButton();
EXPECT_TRUE(state1->IsMinimized());
EXPECT_TRUE(state2->IsMinimized());
EXPECT_TRUE(state3->IsMinimized());
@@ -1801,9 +1800,8 @@
EXPECT_TRUE(std::equal(ordering.begin(), ordering.end(), new_order.begin()));
}
-// Tests that the app list button will end split view mode.
-TEST_F(AppListPresenterDelegateHomeLauncherTest,
- AppListButtonEndSplitViewMode) {
+// Tests that the home button will end split view mode.
+TEST_F(AppListPresenterDelegateHomeLauncherTest, HomeButtonEndSplitViewMode) {
// Show app list in tablet mode. Enter split view mode.
EnableTabletMode(true);
GetAppListTestHelper()->CheckVisibility(true);
@@ -1813,14 +1811,14 @@
split_view_controller->SnapWindow(window.get(), SplitViewController::LEFT);
EXPECT_TRUE(split_view_controller->InSplitViewMode());
- // Press app list button.
- PressAppListButton();
+ // Press home button.
+ PressHomeButton();
EXPECT_FALSE(split_view_controller->InSplitViewMode());
GetAppListTestHelper()->CheckVisibility(true);
}
-// Tests that the app list button will end overview mode.
-TEST_F(AppListPresenterDelegateHomeLauncherTest, AppListButtonEndOverviewMode) {
+// Tests that the home button will end overview mode.
+TEST_F(AppListPresenterDelegateHomeLauncherTest, HomeButtonEndOverviewMode) {
// Show app list in tablet mode. Enter overview mode.
EnableTabletMode(true);
GetAppListTestHelper()->CheckVisibility(true);
@@ -1829,8 +1827,8 @@
overview_controller->StartOverview();
EXPECT_TRUE(overview_controller->InOverviewSession());
- // Press app list button.
- PressAppListButton();
+ // Press home button.
+ PressHomeButton();
EXPECT_FALSE(overview_controller->InOverviewSession());
GetAppListTestHelper()->CheckVisibility(true);
}
diff --git a/ash/app_list/app_list_unittest.cc b/ash/app_list/app_list_unittest.cc
index 75ab567..41dbbeb 100644
--- a/ash/app_list/app_list_unittest.cc
+++ b/ash/app_list/app_list_unittest.cc
@@ -7,7 +7,7 @@
#include "ash/app_list/app_list_controller_impl.h"
#include "ash/app_list/presenter/app_list_presenter_impl.h"
#include "ash/public/cpp/shell_window_ids.h"
-#include "ash/shelf/app_list_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_view.h"
#include "ash/shelf/shelf_view_test_api.h"
@@ -22,39 +22,39 @@
using AppListTest = AshTestBase;
// An integration test to toggle the app list by pressing the shelf button.
-TEST_F(AppListTest, PressAppListButtonToShowAndDismiss) {
+TEST_F(AppListTest, PressHomeButtonToShowAndDismiss) {
aura::Window* root_window = Shell::GetPrimaryRootWindow();
Shelf* shelf = Shelf::ForWindow(root_window);
ShelfWidget* shelf_widget = shelf->shelf_widget();
ShelfView* shelf_view = shelf->GetShelfViewForTesting();
ShelfViewTestAPI(shelf_view).RunMessageLoopUntilAnimationsDone();
- AppListButton* app_list_button = shelf_widget->GetAppListButton();
- // Ensure animations progressed to give the app list button a non-empty size.
- ASSERT_GT(app_list_button->GetBoundsInScreen().height(), 0);
+ HomeButton* home_button = shelf_widget->GetHomeButton();
+ // Ensure animations progressed to give the home button a non-empty size.
+ ASSERT_GT(home_button->GetBoundsInScreen().height(), 0);
aura::Window* app_list_container =
root_window->GetChildById(kShellWindowId_AppListContainer);
ui::test::EventGenerator generator(root_window);
- // Click the app list button to show the app list.
+ // Click the home button to show the app list.
auto* controller = Shell::Get()->app_list_controller();
auto* presenter = controller->presenter();
EXPECT_FALSE(controller->GetTargetVisibility());
EXPECT_FALSE(presenter->GetTargetVisibility());
EXPECT_EQ(0u, app_list_container->children().size());
- EXPECT_FALSE(app_list_button->IsShowingAppList());
+ EXPECT_FALSE(home_button->IsShowingAppList());
generator.set_current_screen_location(
- app_list_button->GetBoundsInScreen().CenterPoint());
+ home_button->GetBoundsInScreen().CenterPoint());
generator.ClickLeftButton();
EXPECT_TRUE(presenter->GetTargetVisibility());
EXPECT_EQ(1u, app_list_container->children().size());
- EXPECT_TRUE(app_list_button->IsShowingAppList());
+ EXPECT_TRUE(home_button->IsShowingAppList());
// Click the button again to dismiss the app list; it will animate to close.
generator.ClickLeftButton();
EXPECT_FALSE(controller->GetTargetVisibility());
EXPECT_EQ(1u, app_list_container->children().size());
- EXPECT_FALSE(app_list_button->IsShowingAppList());
+ EXPECT_FALSE(home_button->IsShowingAppList());
}
} // namespace ash
diff --git a/ash/app_list/views/app_list_view.cc b/ash/app_list/views/app_list_view.cc
index 59a944a..ba0f680 100644
--- a/ash/app_list/views/app_list_view.cc
+++ b/ash/app_list/views/app_list_view.cc
@@ -274,7 +274,7 @@
"DragReleaseHide",
value);
break;
- case TabletModeAnimationTransition::kAppListButtonShow:
+ case TabletModeAnimationTransition::kHomeButtonShow:
UMA_HISTOGRAM_PERCENTAGE(
"Apps.HomeLauncherTransition.AnimationSmoothness."
"PressAppListButtonShow",
diff --git a/ash/first_run/first_run_helper_impl.cc b/ash/first_run/first_run_helper_impl.cc
index 223e0cfc..74eca845 100644
--- a/ash/first_run/first_run_helper_impl.cc
+++ b/ash/first_run/first_run_helper_impl.cc
@@ -11,7 +11,7 @@
#include "ash/first_run/desktop_cleaner.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller_impl.h"
-#include "ash/shelf/app_list_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
@@ -43,8 +43,8 @@
gfx::Rect FirstRunHelperImpl::GetAppListButtonBounds() {
Shelf* shelf = Shelf::ForWindow(Shell::GetPrimaryRootWindow());
- AppListButton* app_button = shelf->shelf_widget()->GetAppListButton();
- return app_button->GetBoundsInScreen();
+ HomeButton* home_button = shelf->shelf_widget()->GetHomeButton();
+ return home_button->GetBoundsInScreen();
}
gfx::Rect FirstRunHelperImpl::OpenTrayBubble() {
diff --git a/ash/public/cpp/first_run_helper.h b/ash/public/cpp/first_run_helper.h
index 35b57f8b..e0b5ed45 100644
--- a/ash/public/cpp/first_run_helper.h
+++ b/ash/public/cpp/first_run_helper.h
@@ -30,7 +30,7 @@
// should cancel the tutorial (e.g. the device is shutting down).
static std::unique_ptr<FirstRunHelper> Start(base::OnceClosure on_cancelled);
- // Returns the bounds of the app list button on the primary display in screen
+ // Returns the bounds of the home button on the primary display in screen
// coordinates.
virtual gfx::Rect GetAppListButtonBounds() = 0;
diff --git a/ash/shelf/assistant_overlay.cc b/ash/shelf/assistant_overlay.cc
index f3a963a..ab2c2fb 100644
--- a/ash/shelf/assistant_overlay.cc
+++ b/ash/shelf/assistant_overlay.cc
@@ -11,7 +11,7 @@
#include "ash/public/cpp/shelf_types.h"
#include "ash/resources/vector_icons/vector_icons.h"
-#include "ash/shelf/app_list_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/ink_drop_button_listener.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_constants.h"
@@ -592,7 +592,7 @@
DISALLOW_COPY_AND_ASSIGN(AssistantIconBackground);
};
-AssistantOverlay::AssistantOverlay(AppListButton* host_view)
+AssistantOverlay::AssistantOverlay(HomeButton* host_view)
: ripple_layer_(std::make_unique<ui::Layer>()),
icon_layer_(std::make_unique<AssistantIcon>()),
background_layer_(std::make_unique<AssistantIconBackground>()),
diff --git a/ash/shelf/assistant_overlay.h b/ash/shelf/assistant_overlay.h
index 6db62fd4..c53d251 100644
--- a/ash/shelf/assistant_overlay.h
+++ b/ash/shelf/assistant_overlay.h
@@ -15,13 +15,13 @@
namespace ash {
-class AppListButton;
+class HomeButton;
class AssistantIconBackground;
class AssistantIcon;
class ASH_EXPORT AssistantOverlay : public views::View {
public:
- explicit AssistantOverlay(AppListButton* host_view);
+ explicit AssistantOverlay(HomeButton* host_view);
~AssistantOverlay() override;
void StartAnimation(bool show_icon);
@@ -55,7 +55,7 @@
std::unique_ptr<AssistantIcon> icon_layer_;
std::unique_ptr<AssistantIconBackground> background_layer_;
- AppListButton* host_view_;
+ HomeButton* host_view_;
AnimationState animation_state_ = AnimationState::HIDDEN;
diff --git a/ash/shelf/default_shelf_view.cc b/ash/shelf/default_shelf_view.cc
index 0703b959..729a4394 100644
--- a/ash/shelf/default_shelf_view.cc
+++ b/ash/shelf/default_shelf_view.cc
@@ -6,8 +6,8 @@
#include "ash/public/cpp/shelf_item.h"
#include "ash/public/cpp/shelf_model.h"
-#include "ash/shelf/app_list_button.h"
#include "ash/shelf/back_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/overflow_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_app_button.h"
@@ -96,7 +96,7 @@
y = shelf()->PrimaryAxisValue(y, y + kShelfControlSize + button_spacing);
}
- GetAppListButton()->set_ideal_bounds(gfx::Rect(
+ GetHomeButton()->set_ideal_bounds(gfx::Rect(
x, y, shelf()->PrimaryAxisValue(kShelfControlSize, kShelfButtonSize),
shelf()->PrimaryAxisValue(kShelfButtonSize, kShelfControlSize)));
}
@@ -150,14 +150,14 @@
// Calculate the bounds for the back and home buttons separately.
CalculateBackAndHomeButtonsIdealBounds();
- int app_list_button_position =
- shelf()->PrimaryAxisValue(GetAppListButton()->ideal_bounds().right(),
- GetAppListButton()->ideal_bounds().bottom());
+ int home_button_position =
+ shelf()->PrimaryAxisValue(GetHomeButton()->ideal_bounds().right(),
+ GetHomeButton()->ideal_bounds().bottom());
- x = shelf()->PrimaryAxisValue(app_list_button_position, 0);
- y = shelf()->PrimaryAxisValue(0, app_list_button_position);
+ x = shelf()->PrimaryAxisValue(home_button_position, 0);
+ y = shelf()->PrimaryAxisValue(0, home_button_position);
- // A larger minimum padding after the app list button is required:
+ // A larger minimum padding after the home button is required:
// increment with the necessary extra amount.
x += shelf()->PrimaryAxisValue(kAppIconGroupMargin - button_spacing, 0);
y += shelf()->PrimaryAxisValue(0, kAppIconGroupMargin - button_spacing);
@@ -185,8 +185,7 @@
kAppIconGroupMargin + (available_size_for_app_icons - icons_size) / 2;
}
- if (padding_for_centering >
- app_list_button_position + kAppIconGroupMargin) {
+ if (padding_for_centering > home_button_position + kAppIconGroupMargin) {
// Only shift buttons to the right, never let them interfere with the
// left-aligned system buttons.
x = shelf()->PrimaryAxisValue(padding_for_centering, 0);
@@ -280,12 +279,12 @@
return std::make_unique<BackButton>(this);
}
-std::unique_ptr<AppListButton> DefaultShelfView::CreateHomeButton() {
- return std::make_unique<AppListButton>(this, shelf());
+std::unique_ptr<HomeButton> DefaultShelfView::CreateHomeButton() {
+ return std::make_unique<HomeButton>(this, shelf());
}
int DefaultShelfView::GetAvailableSpaceForAppIcons() const {
- // Subtract space already allocated to the app list button, and the back
+ // Subtract space already allocated to the home button, and the back
// button if applicable.
return shelf()->PrimaryAxisValue(width(), height()) - kShelfButtonSpacing -
(IsTabletModeEnabled() ? 2 : 1) * kShelfControlSize -
@@ -325,7 +324,7 @@
// An easy way to check whether the apps fit at the exact center of the
// screen is to imagine that we have another status widget on the other
- // side (the status widget is always bigger than the app list button plus
+ // side (the status widget is always bigger than the home button plus
// the back button if applicable) and see if the apps can fit in the middle.
int available_space_for_screen_centering =
screen_size - 2 * (status_widget_size + kAppIconGroupMargin);
diff --git a/ash/shelf/default_shelf_view.h b/ash/shelf/default_shelf_view.h
index 163541f7..3fc0f50 100644
--- a/ash/shelf/default_shelf_view.h
+++ b/ash/shelf/default_shelf_view.h
@@ -38,7 +38,7 @@
void CalculateIdealBounds() override;
void LayoutAppListAndBackButtonHighlight() override;
std::unique_ptr<BackButton> CreateBackButton() override;
- std::unique_ptr<AppListButton> CreateHomeButton() override;
+ std::unique_ptr<HomeButton> CreateHomeButton() override;
private:
struct AppCenteringStrategy {
@@ -47,7 +47,7 @@
};
// Returns the size that's actually available for app icons. Size occupied
- // by the app list button and back button plus all appropriate margins is
+ // by the home button and back button plus all appropriate margins is
// not available for app icons.
int GetAvailableSpaceForAppIcons() const;
diff --git a/ash/shelf/app_list_button.cc b/ash/shelf/home_button.cc
similarity index 82%
rename from ash/shelf/app_list_button.cc
rename to ash/shelf/home_button.cc
index 4a975a8..519bbaf 100644
--- a/ash/shelf/app_list_button.cc
+++ b/ash/shelf/home_button.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/shelf/app_list_button.h"
+#include "ash/shelf/home_button.h"
#include <math.h> // std::ceil
@@ -30,9 +30,9 @@
} // namespace
// static
-const char AppListButton::kViewClassName[] = "ash/AppListButton";
+const char HomeButton::kViewClassName[] = "ash/HomeButton";
-AppListButton::AppListButton(ShelfView* shelf_view, Shelf* shelf)
+HomeButton::HomeButton(ShelfView* shelf_view, Shelf* shelf)
: ShelfControlButton(shelf_view), controller_(this, shelf) {
DCHECK(shelf_view);
DCHECK(shelf);
@@ -44,29 +44,29 @@
SetEventTargeter(std::make_unique<views::ViewTargeter>(this));
}
-AppListButton::~AppListButton() = default;
+HomeButton::~HomeButton() = default;
-void AppListButton::OnGestureEvent(ui::GestureEvent* event) {
+void HomeButton::OnGestureEvent(ui::GestureEvent* event) {
if (!controller_.MaybeHandleGestureEvent(event, shelf_view()))
Button::OnGestureEvent(event);
}
-const char* AppListButton::GetClassName() const {
+const char* HomeButton::GetClassName() const {
return kViewClassName;
}
-void AppListButton::OnVoiceInteractionAvailabilityChanged() {
+void HomeButton::OnVoiceInteractionAvailabilityChanged() {
SchedulePaint();
}
-bool AppListButton::IsShowingAppList() const {
+bool HomeButton::IsShowingAppList() const {
return controller_.is_showing_app_list();
}
-void AppListButton::OnPressed(app_list::AppListShowSource show_source,
- base::TimeTicks time_stamp) {
+void HomeButton::OnPressed(app_list::AppListShowSource show_source,
+ base::TimeTicks time_stamp) {
ShelfAction shelf_action =
- Shell::Get()->app_list_controller()->OnAppListButtonPressed(
+ Shell::Get()->app_list_controller()->OnHomeButtonPressed(
shelf_view()->GetDisplayId(), show_source, time_stamp);
if (shelf_action == SHELF_ACTION_APP_LIST_DISMISSED) {
GetInkDrop()->SnapToActivated();
@@ -74,7 +74,7 @@
}
}
-void AppListButton::PaintButtonContents(gfx::Canvas* canvas) {
+void HomeButton::PaintButtonContents(gfx::Canvas* canvas) {
gfx::PointF circle_center(GetCenterPoint());
// Paint a white ring as the foreground for the app list circle. The ceil/dsf
@@ -118,8 +118,8 @@
}
}
-bool AppListButton::DoesIntersectRect(const views::View* target,
- const gfx::Rect& rect) const {
+bool HomeButton::DoesIntersectRect(const views::View* target,
+ const gfx::Rect& rect) const {
DCHECK_EQ(target, this);
gfx::Rect button_bounds = target->GetLocalBounds();
// Increase clickable area for the button from
diff --git a/ash/shelf/app_list_button.h b/ash/shelf/home_button.h
similarity index 78%
rename from ash/shelf/app_list_button.h
rename to ash/shelf/home_button.h
index 3606dd8..76abc80 100644
--- a/ash/shelf/app_list_button.h
+++ b/ash/shelf/home_button.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_SHELF_APP_LIST_BUTTON_H_
-#define ASH_SHELF_APP_LIST_BUTTON_H_
+#ifndef ASH_SHELF_HOME_BUTTON_H_
+#define ASH_SHELF_HOME_BUTTON_H_
#include <memory>
#include "ash/app_list/app_list_metrics.h"
#include "ash/ash_export.h"
-#include "ash/shelf/app_list_button_controller.h"
+#include "ash/shelf/home_button_controller.h"
#include "ash/shelf/shelf_control_button.h"
#include "base/macros.h"
#include "ui/views/view_targeter_delegate.h"
@@ -26,13 +26,13 @@
//
// If Assistant is enabled, the button is filled in; long-pressing it will
// launch Assistant.
-class ASH_EXPORT AppListButton : public ShelfControlButton,
- public views::ViewTargeterDelegate {
+class ASH_EXPORT HomeButton : public ShelfControlButton,
+ public views::ViewTargeterDelegate {
public:
static const char kViewClassName[];
- AppListButton(ShelfView* shelf_view, Shelf* shelf);
- ~AppListButton() override;
+ HomeButton(ShelfView* shelf_view, Shelf* shelf);
+ ~HomeButton() override;
// views::Button:
void OnGestureEvent(ui::GestureEvent* event) override;
@@ -58,11 +58,11 @@
const gfx::Rect& rect) const override;
// The controller used to determine the button's behavior.
- AppListButtonController controller_;
+ HomeButtonController controller_;
- DISALLOW_COPY_AND_ASSIGN(AppListButton);
+ DISALLOW_COPY_AND_ASSIGN(HomeButton);
};
} // namespace ash
-#endif // ASH_SHELF_APP_LIST_BUTTON_H_
+#endif // ASH_SHELF_HOME_BUTTON_H_
diff --git a/ash/shelf/app_list_button_controller.cc b/ash/shelf/home_button_controller.cc
similarity index 86%
rename from ash/shelf/app_list_button_controller.cc
rename to ash/shelf/home_button_controller.cc
index bd9ba84..67c95ab 100644
--- a/ash/shelf/app_list_button_controller.cc
+++ b/ash/shelf/home_button_controller.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/shelf/app_list_button_controller.h"
+#include "ash/shelf/home_button_controller.h"
#include "ash/app_list/app_list_controller_impl.h"
#include "ash/assistant/assistant_controller.h"
#include "ash/home_screen/home_screen_controller.h"
#include "ash/public/cpp/voice_interaction_controller.h"
#include "ash/session/session_controller_impl.h"
-#include "ash/shelf/app_list_button.h"
#include "ash/shelf/assistant_overlay.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_view.h"
#include "ash/shell.h"
@@ -42,8 +42,7 @@
} // namespace
-AppListButtonController::AppListButtonController(AppListButton* button,
- Shelf* shelf)
+HomeButtonController::HomeButtonController(HomeButton* button, Shelf* shelf)
: button_(button), shelf_(shelf) {
DCHECK(button_);
DCHECK(shelf_);
@@ -64,7 +63,7 @@
}
}
-AppListButtonController::~AppListButtonController() {
+HomeButtonController::~HomeButtonController() {
Shell* shell = Shell::Get();
// AppListController and TabletModeController are destroyed early when Shell
@@ -77,8 +76,8 @@
VoiceInteractionController::Get()->RemoveLocalObserver(this);
}
-bool AppListButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event,
- ShelfView* shelf_view) {
+bool HomeButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event,
+ ShelfView* shelf_view) {
switch (event->type()) {
case ui::ET_GESTURE_TAP:
case ui::ET_GESTURE_TAP_CANCEL:
@@ -106,7 +105,7 @@
base::TimeDelta::FromMilliseconds(
kVoiceInteractionAnimationDelayMs),
base::BindOnce(
- &AppListButtonController::StartVoiceInteractionAnimation,
+ &HomeButtonController::StartVoiceInteractionAnimation,
base::Unretained(this)));
}
@@ -120,7 +119,7 @@
return false;
base::RecordAction(base::UserMetricsAction(
- "VoiceInteraction.Started.AppListButtonLongPress"));
+ "VoiceInteraction.Started.HomeButtonLongPress"));
assistant_overlay_->BurstAnimation();
event->SetHandled();
Shell::Get()->shell_state()->SetRootWindowForNewWindows(
@@ -145,7 +144,7 @@
}
}
-bool AppListButtonController::IsVoiceInteractionAvailable() {
+bool HomeButtonController::IsVoiceInteractionAvailable() {
VoiceInteractionController* controller = VoiceInteractionController::Get();
bool settings_enabled = controller->settings_enabled().value_or(false);
bool consent_given = controller->consent_status() ==
@@ -157,14 +156,14 @@
(settings_enabled || !consent_given);
}
-bool AppListButtonController::IsVoiceInteractionRunning() {
+bool HomeButtonController::IsVoiceInteractionRunning() {
return VoiceInteractionController::Get()->voice_interaction_state().value_or(
mojom::VoiceInteractionState::STOPPED) ==
mojom::VoiceInteractionState::RUNNING;
}
-void AppListButtonController::OnAppListVisibilityChanged(bool shown,
- int64_t display_id) {
+void HomeButtonController::OnAppListVisibilityChanged(bool shown,
+ int64_t display_id) {
if (display::Screen::GetScreen()
->GetDisplayNearestWindow(button_->GetWidget()->GetNativeWindow())
.id() != display_id) {
@@ -176,7 +175,7 @@
OnAppListDismissed();
}
-void AppListButtonController::OnActiveUserSessionChanged(
+void HomeButtonController::OnActiveUserSessionChanged(
const AccountId& account_id) {
button_->OnVoiceInteractionAvailabilityChanged();
// Initialize voice interaction overlay when primary user session becomes
@@ -187,11 +186,11 @@
}
}
-void AppListButtonController::OnTabletModeStarted() {
+void HomeButtonController::OnTabletModeStarted() {
button_->AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr);
}
-void AppListButtonController::OnVoiceInteractionStatusChanged(
+void HomeButtonController::OnVoiceInteractionStatusChanged(
mojom::VoiceInteractionState state) {
button_->OnVoiceInteractionAvailabilityChanged();
@@ -230,20 +229,20 @@
}
}
-void AppListButtonController::OnVoiceInteractionSettingsEnabled(bool enabled) {
+void HomeButtonController::OnVoiceInteractionSettingsEnabled(bool enabled) {
button_->OnVoiceInteractionAvailabilityChanged();
}
-void AppListButtonController::OnVoiceInteractionConsentStatusUpdated(
+void HomeButtonController::OnVoiceInteractionConsentStatusUpdated(
mojom::ConsentStatus consent_status) {
button_->OnVoiceInteractionAvailabilityChanged();
}
-void AppListButtonController::StartVoiceInteractionAnimation() {
+void HomeButtonController::StartVoiceInteractionAnimation() {
assistant_overlay_->StartAnimation(false);
}
-void AppListButtonController::OnAppListShown() {
+void HomeButtonController::OnAppListShown() {
// Do not show a highlight if the home screen is available, since the home
// screen view is always open in the background.
if (!Shell::Get()->home_screen_controller()->IsHomeScreenAvailable())
@@ -252,13 +251,13 @@
shelf_->UpdateAutoHideState();
}
-void AppListButtonController::OnAppListDismissed() {
+void HomeButtonController::OnAppListDismissed() {
button_->AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr);
is_showing_app_list_ = false;
shelf_->UpdateAutoHideState();
}
-void AppListButtonController::InitializeVoiceInteractionOverlay() {
+void HomeButtonController::InitializeVoiceInteractionOverlay() {
assistant_overlay_ = new AssistantOverlay(button_);
button_->AddChildView(assistant_overlay_);
assistant_overlay_->SetVisible(false);
diff --git a/ash/shelf/app_list_button_controller.h b/ash/shelf/home_button_controller.h
similarity index 76%
rename from ash/shelf/app_list_button_controller.h
rename to ash/shelf/home_button_controller.h
index 7203fada..3ffa870b 100644
--- a/ash/shelf/app_list_button_controller.h
+++ b/ash/shelf/home_button_controller.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_SHELF_APP_LIST_BUTTON_CONTROLLER_H_
-#define ASH_SHELF_APP_LIST_BUTTON_CONTROLLER_H_
+#ifndef ASH_SHELF_HOME_BUTTON_CONTROLLER_H_
+#define ASH_SHELF_HOME_BUTTON_CONTROLLER_H_
#include <memory>
@@ -25,26 +25,26 @@
namespace ash {
class AssistantOverlay;
-class AppListButton;
+class HomeButton;
class Shelf;
class ShelfView;
-// Controls behavior of the AppListButton, including a possible long-press
+// Controls behavior of the HomeButton, including a possible long-press
// action (for Assistant).
-// Behavior is tested indirectly in AppListButtonTest and ShelfViewInkDropTest.
-class AppListButtonController : public AppListControllerObserver,
- public SessionObserver,
- public TabletModeObserver,
- public DefaultVoiceInteractionObserver {
+// Behavior is tested indirectly in HomeButtonTest and ShelfViewInkDropTest.
+class HomeButtonController : public AppListControllerObserver,
+ public SessionObserver,
+ public TabletModeObserver,
+ public DefaultVoiceInteractionObserver {
public:
- AppListButtonController(AppListButton* button, Shelf* shelf);
- ~AppListButtonController() override;
+ HomeButtonController(HomeButton* button, Shelf* shelf);
+ ~HomeButtonController() override;
// Maybe handles a gesture event based on the event and whether voice
// interaction is available.
// |shelf_view| is used to determine whether it is safe to animate the ripple.
//
- // Returns true if the event is consumed; otherwise, AppListButton should pass
+ // Returns true if the event is consumed; otherwise, HomeButton should pass
// the event along to Button to consume.
bool MaybeHandleGestureEvent(ui::GestureEvent* event, ShelfView* shelf_view);
@@ -86,7 +86,7 @@
bool is_showing_app_list_ = false;
// The button that owns this controller.
- AppListButton* const button_;
+ HomeButton* const button_;
// The shelf the button resides in.
Shelf* const shelf_;
@@ -98,9 +98,9 @@
std::unique_ptr<base::OneShotTimer> assistant_animation_hide_delay_timer_;
base::TimeTicks voice_interaction_start_timestamp_;
- DISALLOW_COPY_AND_ASSIGN(AppListButtonController);
+ DISALLOW_COPY_AND_ASSIGN(HomeButtonController);
};
} // namespace ash
-#endif // ASH_SHELF_APP_LIST_BUTTON_CONTROLLER_H_
+#endif // ASH_SHELF_HOME_BUTTON_CONTROLLER_H_
diff --git a/ash/shelf/app_list_button_unittest.cc b/ash/shelf/home_button_unittest.cc
similarity index 86%
rename from ash/shelf/app_list_button_unittest.cc
rename to ash/shelf/home_button_unittest.cc
index bc5c773..f3eb520 100644
--- a/ash/shelf/app_list_button_unittest.cc
+++ b/ash/shelf/home_button_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/shelf/app_list_button.h"
+#include "ash/shelf/home_button.h"
#include <memory>
#include <string>
@@ -41,21 +41,18 @@
return ui::GestureEvent(0, 0, ui::EF_NONE, base::TimeTicks(), details);
}
-// TODO(michaelpg): Rename AppListButtonTest => HomeButtonTest.
-class AppListButtonTest : public AshTestBase {
+class HomeButtonTest : public AshTestBase {
public:
- AppListButtonTest() = default;
- ~AppListButtonTest() override = default;
+ HomeButtonTest() = default;
+ ~HomeButtonTest() override = default;
// AshTestBase:
- void SetUp() override {
- AshTestBase::SetUp();
- }
+ void SetUp() override { AshTestBase::SetUp(); }
void SendGestureEvent(ui::GestureEvent* event) {
GetPrimaryShelf()
->GetShelfViewForTesting()
- ->GetAppListButton()
+ ->GetHomeButton()
->OnGestureEvent(event);
}
@@ -65,25 +62,25 @@
// Send the gesture event to the secondary display.
Shelf::ForWindow(Shell::GetAllRootWindows()[1])
->GetShelfViewForTesting()
- ->GetAppListButton()
+ ->GetHomeButton()
->OnGestureEvent(event);
}
- const AppListButton* app_list_button() const {
- return GetPrimaryShelf()->GetShelfViewForTesting()->GetAppListButton();
+ const HomeButton* home_button() const {
+ return GetPrimaryShelf()->GetShelfViewForTesting()->GetHomeButton();
}
private:
- DISALLOW_COPY_AND_ASSIGN(AppListButtonTest);
+ DISALLOW_COPY_AND_ASSIGN(HomeButtonTest);
};
-TEST_F(AppListButtonTest, SwipeUpToOpenFullscreenAppList) {
+TEST_F(HomeButtonTest, SwipeUpToOpenFullscreenAppList) {
Shelf* shelf = GetPrimaryShelf();
EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->alignment());
- // Start the drags from the center of the app list button.
- gfx::Point start = app_list_button()->GetCenterPoint();
- views::View::ConvertPointToScreen(app_list_button(), &start);
+ // Start the drags from the center of the home button.
+ gfx::Point start = home_button()->GetCenterPoint();
+ views::View::ConvertPointToScreen(home_button(), &start);
// Swiping up less than the threshold should trigger a peeking app list.
gfx::Point end = start;
end.set_y(shelf->GetIdealBounds().bottom() -
@@ -110,15 +107,15 @@
GetAppListTestHelper()->CheckState(ash::AppListViewState::kFullscreenAllApps);
}
-TEST_F(AppListButtonTest, ClickToOpenAppList) {
+TEST_F(HomeButtonTest, ClickToOpenAppList) {
Shelf* shelf = GetPrimaryShelf();
EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->alignment());
- gfx::Point center = app_list_button()->GetCenterPoint();
- views::View::ConvertPointToScreen(app_list_button(), ¢er);
+ gfx::Point center = home_button()->GetCenterPoint();
+ views::View::ConvertPointToScreen(home_button(), ¢er);
GetEventGenerator()->MoveMouseTo(center);
- // Click on the app list button should toggle the app list.
+ // Click on the home button should toggle the app list.
GetEventGenerator()->ClickLeftButton();
GetAppListTestHelper()->WaitUntilIdle();
GetAppListTestHelper()->CheckVisibility(true);
@@ -145,7 +142,7 @@
GetAppListTestHelper()->CheckState(ash::AppListViewState::kClosed);
}
-TEST_F(AppListButtonTest, ButtonPositionInTabletMode) {
+TEST_F(HomeButtonTest, ButtonPositionInTabletMode) {
// Finish all setup tasks. In particular we want to finish the
// GetSwitchStates post task in (Fake)PowerManagerClient which is triggered
// by TabletModeController otherwise this will cause tablet mode to exit
@@ -155,14 +152,14 @@
ShelfViewTestAPI test_api(GetPrimaryShelf()->GetShelfViewForTesting());
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
test_api.RunMessageLoopUntilAnimationsDone();
- EXPECT_GT(app_list_button()->bounds().x(), 0);
+ EXPECT_GT(home_button()->bounds().x(), 0);
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(false);
test_api.RunMessageLoopUntilAnimationsDone();
- EXPECT_EQ(ShelfConstants::button_spacing(), app_list_button()->bounds().x());
+ EXPECT_EQ(ShelfConstants::button_spacing(), home_button()->bounds().x());
}
-TEST_F(AppListButtonTest, LongPressGesture) {
+TEST_F(HomeButtonTest, LongPressGesture) {
ui::ScopedAnimationDurationScaleMode animation_duration_mode(
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
// Simulate two user with primary user as active.
@@ -197,7 +194,7 @@
->visibility());
}
-TEST_F(AppListButtonTest, LongPressGestureWithSecondaryUser) {
+TEST_F(HomeButtonTest, LongPressGestureWithSecondaryUser) {
// Disallowed by secondary user.
VoiceInteractionController::Get()->NotifyFeatureAllowed(
mojom::AssistantAllowedState::DISALLOWED_BY_NONPRIMARY_USER);
@@ -224,7 +221,7 @@
->visibility());
}
-TEST_F(AppListButtonTest, LongPressGestureWithSettingsDisabled) {
+TEST_F(HomeButtonTest, LongPressGestureWithSettingsDisabled) {
// Simulate two user with primary user as active.
CreateUserSessions(2);
@@ -252,7 +249,7 @@
->visibility());
}
-class KioskNextHomeButtonTest : public AppListButtonTest {
+class KioskNextHomeButtonTest : public HomeButtonTest {
public:
KioskNextHomeButtonTest() {
scoped_feature_list_.InitAndEnableFeature(features::kKioskNextShell);
@@ -260,13 +257,13 @@
void SetUp() override {
set_start_session(false);
- AppListButtonTest::SetUp();
+ HomeButtonTest::SetUp();
client_ = std::make_unique<MockKioskNextShellClient>();
}
void TearDown() override {
client_.reset();
- AppListButtonTest::TearDown();
+ HomeButtonTest::TearDown();
}
private:
@@ -289,8 +286,8 @@
test_api.RunMessageLoopUntilAnimationsDone();
// Tapping the home button should exit Overview mode.
- gfx::Point center = app_list_button()->GetCenterPoint();
- views::View::ConvertPointToScreen(app_list_button(), ¢er);
+ gfx::Point center = home_button()->GetCenterPoint();
+ views::View::ConvertPointToScreen(home_button(), ¢er);
GetEventGenerator()->GestureTapDownAndUp(center);
test_api.RunMessageLoopUntilAnimationsDone();
EXPECT_FALSE(overview_controller->InOverviewSession());
diff --git a/ash/shelf/kiosk_next_shelf_view.cc b/ash/shelf/kiosk_next_shelf_view.cc
index dc55061..4b1fb4e4 100644
--- a/ash/shelf/kiosk_next_shelf_view.cc
+++ b/ash/shelf/kiosk_next_shelf_view.cc
@@ -9,8 +9,8 @@
#include "ash/display/screen_orientation_controller.h"
#include "ash/home_screen/home_screen_controller.h"
#include "ash/public/cpp/shelf_model.h"
-#include "ash/shelf/app_list_button.h"
#include "ash/shelf/back_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/overflow_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_constants.h"
@@ -63,17 +63,17 @@
};
// Kiosk Next home button with permanent round rectangle background.
-class KioskNextHomeButton : public AppListButton {
+class KioskNextHomeButton : public HomeButton {
public:
KioskNextHomeButton(ShelfView* shelf_view, Shelf* shelf)
- : AppListButton(shelf_view, shelf) {}
+ : HomeButton(shelf_view, shelf) {}
~KioskNextHomeButton() override = default;
private:
- // views::AppListButton:
+ // views::HomeButton:
void PaintButtonContents(gfx::Canvas* canvas) override {
PaintBackground(canvas, GetContentsBounds());
- AppListButton::PaintButtonContents(canvas);
+ HomeButton::PaintButtonContents(canvas);
}
std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override {
@@ -151,7 +151,7 @@
GetBackButton()->set_ideal_bounds(gfx::Rect(
x, y, kKioskNextShelfControlWidthDp, kKioskNextShelfControlHeightDp));
x += (kKioskNextShelfControlWidthDp + control_buttons_spacing);
- GetAppListButton()->set_ideal_bounds(gfx::Rect(
+ GetHomeButton()->set_ideal_bounds(gfx::Rect(
x, y, kKioskNextShelfControlWidthDp, kKioskNextShelfControlHeightDp));
}
@@ -159,7 +159,7 @@
return std::make_unique<KioskNextBackButton>(this);
}
-std::unique_ptr<AppListButton> KioskNextShelfView::CreateHomeButton() {
+std::unique_ptr<HomeButton> KioskNextShelfView::CreateHomeButton() {
return std::make_unique<KioskNextHomeButton>(this, shelf());
}
diff --git a/ash/shelf/kiosk_next_shelf_view.h b/ash/shelf/kiosk_next_shelf_view.h
index 35a6259a..31e9394 100644
--- a/ash/shelf/kiosk_next_shelf_view.h
+++ b/ash/shelf/kiosk_next_shelf_view.h
@@ -35,7 +35,7 @@
void Init() override;
void CalculateIdealBounds() override;
std::unique_ptr<BackButton> CreateBackButton() override;
- std::unique_ptr<AppListButton> CreateHomeButton() override;
+ std::unique_ptr<HomeButton> CreateHomeButton() override;
private:
DISALLOW_COPY_AND_ASSIGN(KioskNextShelfView);
diff --git a/ash/shelf/shelf.h b/ash/shelf/shelf.h
index bca38c6..9a37ed1 100644
--- a/ash/shelf/shelf.h
+++ b/ash/shelf/shelf.h
@@ -232,7 +232,7 @@
// (animation value = 0.0). This is because this is set to true when we
// enter/exit tablet mode but the animation is not started until a shelf
// OnBoundsChanged is called because of tablet mode. Use this value to sync
- // the animation for AppListButton.
+ // the animation for HomeButton.
bool is_tablet_mode_animation_running_ = false;
// Used by ScopedAutoHideLock to maintain the state of the lock for auto-hide
diff --git a/ash/shelf/shelf_constants.h b/ash/shelf/shelf_constants.h
index 57e455b..64d1d27 100644
--- a/ash/shelf/shelf_constants.h
+++ b/ash/shelf/shelf_constants.h
@@ -21,7 +21,7 @@
// Size of the icons within shelf buttons.
constexpr int kShelfButtonIconSize = 44;
-// Size for controls like the app list button, back button, etc.
+// Size for controls like the home button, back button, etc.
constexpr int kShelfControlSize = 40;
ASH_EXPORT constexpr SkColor kShelfControlPermanentHighlightBackground =
diff --git a/ash/shelf/shelf_context_menu_model.cc b/ash/shelf/shelf_context_menu_model.cc
index dd5f546..773569c 100644
--- a/ash/shelf/shelf_context_menu_model.cc
+++ b/ash/shelf/shelf_context_menu_model.cc
@@ -59,7 +59,7 @@
ShelfContextMenuModel::ShelfContextMenuModel(ShelfItemDelegate* delegate,
int64_t display_id)
: ui::SimpleMenuModel(this), delegate_(delegate), display_id_(display_id) {
- // Add shelf and wallpaper items if ShelfView or AppListButton are selected.
+ // Add shelf and wallpaper items if ShelfView or HomeButton are selected.
if (!delegate || delegate_->app_id() == kAppListId)
AddShelfAndWallpaperItems();
}
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index 09c55e4..dc925a4a 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -32,7 +32,7 @@
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
#include "ash/session/session_controller_impl.h"
-#include "ash/shelf/app_list_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_constants.h"
#include "ash/shelf/shelf_controller.h"
@@ -88,8 +88,8 @@
namespace ash {
namespace {
-void PressAppListButton() {
- Shell::Get()->app_list_controller()->OnAppListButtonPressed(
+void PressHomeButton() {
+ Shell::Get()->app_list_controller()->OnHomeButtonPressed(
display::Screen::GetScreen()->GetPrimaryDisplay().id(),
app_list::AppListShowSource::kShelfButton, base::TimeTicks());
}
@@ -1862,7 +1862,7 @@
// Calculate drag start point and end point. |start_point| and |target_point|
// make sure that mouse event is received by Shelf/AppListView instead of
- // child views (like AppListButton and SearchBoxView).
+ // child views (like HomeButton and SearchBoxView).
int x = shelf_bounds_in_screen.x() + shelf_bounds_in_screen.width() / 4;
int y = shelf_bounds_in_screen.CenterPoint().y();
gfx::Point start_point(x, y);
@@ -2686,7 +2686,7 @@
&update_event, GetShelfWidget()->GetNativeView());
// Emulate to press the AppList button while dragging the Shelf.
- PressAppListButton();
+ PressHomeButton();
EXPECT_TRUE(GetPrimaryShelf()->IsVisible());
// Release the press.
@@ -2708,7 +2708,7 @@
// things:
// (1) Shelf is hidden
// (2) Shelf has correct bounds in screen coordinate.
- PressAppListButton();
+ PressHomeButton();
EXPECT_EQ(GetScreenAvailableBounds().bottom_left() +
gfx::Point(0, -kHiddenShelfInScreenPortion).OffsetFromOrigin(),
GetPrimaryShelf()
@@ -2742,10 +2742,10 @@
GetPrimaryShelf()->shelf_widget()->OnGestureEvent(&update_event);
// Press the AppList button by mouse.
- views::View* app_list_button =
- GetPrimaryShelf()->GetShelfViewForTesting()->GetAppListButton();
+ views::View* home_button =
+ GetPrimaryShelf()->GetShelfViewForTesting()->GetHomeButton();
GetEventGenerator()->MoveMouseTo(
- app_list_button->GetBoundsInScreen().CenterPoint());
+ home_button->GetBoundsInScreen().CenterPoint());
GetEventGenerator()->ClickLeftButton();
// End the gesture event.
@@ -3024,14 +3024,14 @@
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
- // Tap app list button should not open the app list and shelf should keep
+ // Tap home button should not open the app list and shelf should keep
// hidden.
- gfx::Rect app_list_button_bounds =
- shelf->GetShelfViewForTesting()->GetAppListButton()->GetBoundsInScreen();
+ gfx::Rect home_button_bounds =
+ shelf->GetShelfViewForTesting()->GetHomeButton()->GetBoundsInScreen();
gfx::Rect display_bounds =
display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
- app_list_button_bounds.Intersect(display_bounds);
- GetEventGenerator()->GestureTapAt(app_list_button_bounds.CenterPoint());
+ home_button_bounds.Intersect(display_bounds);
+ GetEventGenerator()->GestureTapAt(home_button_bounds.CenterPoint());
GetAppListTestHelper()->CheckVisibility(false);
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
}
diff --git a/ash/shelf/shelf_tooltip_manager_unittest.cc b/ash/shelf/shelf_tooltip_manager_unittest.cc
index d7e1d68..83fc073 100644
--- a/ash/shelf/shelf_tooltip_manager_unittest.cc
+++ b/ash/shelf/shelf_tooltip_manager_unittest.cc
@@ -7,7 +7,7 @@
#include <memory>
#include "ash/public/cpp/shelf_model.h"
-#include "ash/shelf/app_list_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_bubble.h"
#include "ash/shelf/shelf_view.h"
@@ -47,14 +47,14 @@
};
TEST_F(ShelfTooltipManagerTest, ShowTooltip) {
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
EXPECT_TRUE(tooltip_manager_->IsVisible());
EXPECT_FALSE(IsTimerRunning());
}
TEST_F(ShelfTooltipManagerTest, ShowTooltipWithDelay) {
// ShowTooltipWithDelay should start the timer instead of showing immediately.
- tooltip_manager_->ShowTooltipWithDelay(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltipWithDelay(shelf_view_->GetHomeButton());
EXPECT_FALSE(tooltip_manager_->IsVisible());
EXPECT_TRUE(IsTimerRunning());
// TODO: Test that the delayed tooltip is shown, without flaky failures.
@@ -93,7 +93,7 @@
}
TEST_F(ShelfTooltipManagerTest, HideWhenShelfIsHidden) {
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
// Create a full-screen window to hide the shelf.
@@ -105,18 +105,18 @@
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Do not show the view if the shelf is hidden.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
EXPECT_FALSE(tooltip_manager_->IsVisible());
// ShowTooltipWithDelay doesn't even start the timer for the hidden shelf.
- tooltip_manager_->ShowTooltipWithDelay(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltipWithDelay(shelf_view_->GetHomeButton());
EXPECT_FALSE(IsTimerRunning());
}
TEST_F(ShelfTooltipManagerTest, HideWhenShelfIsAutoHideHidden) {
// Create a visible window so auto-hide behavior can actually hide the shelf.
std::unique_ptr<views::Widget> widget = CreateTestWidget();
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
GetPrimaryShelf()->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
@@ -127,11 +127,11 @@
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Do not show the view if the shelf is hidden.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
EXPECT_FALSE(tooltip_manager_->IsVisible());
// ShowTooltipWithDelay doesn't even run the timer for the hidden shelf.
- tooltip_manager_->ShowTooltipWithDelay(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltipWithDelay(shelf_view_->GetHomeButton());
EXPECT_FALSE(IsTimerRunning());
// Close the window to show the auto-hide shelf; tooltips should now show.
@@ -142,11 +142,11 @@
ASSERT_EQ(SHELF_AUTO_HIDE_SHOWN, GetPrimaryShelf()->GetAutoHideState());
// The tooltip should show for an auto-hide-shown shelf.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
EXPECT_TRUE(tooltip_manager_->IsVisible());
// ShowTooltipWithDelay should run the timer for an auto-hide-shown shelf.
- tooltip_manager_->ShowTooltipWithDelay(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltipWithDelay(shelf_view_->GetHomeButton());
EXPECT_TRUE(IsTimerRunning());
}
@@ -155,28 +155,28 @@
gfx::Rect shelf_bounds = shelf_view_->GetBoundsInScreen();
// Should hide if the mouse exits the shelf area.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator->MoveMouseTo(shelf_bounds.CenterPoint());
generator->SendMouseExit();
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Should hide if the mouse is pressed in the shelf area.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator->MoveMouseTo(shelf_bounds.CenterPoint());
generator->PressLeftButton();
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Should hide for touch events in the shelf.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator->set_current_screen_location(shelf_bounds.CenterPoint());
generator->PressTouch();
EXPECT_FALSE(tooltip_manager_->IsVisible());
// Should hide for gesture events in the shelf.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator->GestureTapDownAndUp(shelf_bounds.CenterPoint());
EXPECT_FALSE(tooltip_manager_->IsVisible());
@@ -186,7 +186,7 @@
ui::test::EventGenerator* generator = GetEventGenerator();
// Should hide for touches outside the shelf.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator->set_current_screen_location(gfx::Point());
generator->PressTouch();
@@ -194,7 +194,7 @@
generator->ReleaseTouch();
// Should hide for touch events on the tooltip.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator->set_current_screen_location(
GetTooltip()->GetWindowBoundsInScreen().CenterPoint());
@@ -203,7 +203,7 @@
generator->ReleaseTouch();
// Should hide for gestures outside the shelf.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator->GestureTapDownAndUp(gfx::Point());
EXPECT_FALSE(tooltip_manager_->IsVisible());
@@ -213,14 +213,14 @@
ui::test::EventGenerator* generator = GetEventGenerator();
// Should hide when 'Esc' is pressed.
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
ASSERT_TRUE(tooltip_manager_->IsVisible());
generator->PressKey(ui::VKEY_ESCAPE, ui::EF_NONE);
EXPECT_FALSE(tooltip_manager_->IsVisible());
}
TEST_F(ShelfTooltipManagerTest, ShelfTooltipDoesNotAffectPipWindow) {
- tooltip_manager_->ShowTooltip(shelf_view_->GetAppListButton());
+ tooltip_manager_->ShowTooltip(shelf_view_->GetHomeButton());
EXPECT_TRUE(tooltip_manager_->IsVisible());
auto display = display::Screen::GetScreen()->GetPrimaryDisplay();
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index e641ce4..094cf0d 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -20,9 +20,9 @@
#include "ash/public/cpp/window_properties.h"
#include "ash/scoped_root_window_for_new_windows.h"
#include "ash/screen_util.h"
-#include "ash/shelf/app_list_button.h"
#include "ash/shelf/back_button.h"
#include "ash/shelf/default_shelf_view.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/overflow_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_app_button.h"
@@ -167,7 +167,7 @@
if (IsTabletModeEnabled())
focusable_views.push_back(main_shelf->GetBackButton());
- focusable_views.push_back(main_shelf->GetAppListButton());
+ focusable_views.push_back(main_shelf->GetHomeButton());
for (int i = main_shelf->first_visible_index();
i <= main_shelf->last_visible_index(); ++i) {
focusable_views.push_back(main_shelf->view_model()->view_at(i));
@@ -353,7 +353,7 @@
ConfigureChildView(back_button_ptr.get());
back_button_ = AddChildView(std::move(back_button_ptr));
- std::unique_ptr<AppListButton> home_button_ptr = CreateHomeButton();
+ std::unique_ptr<HomeButton> home_button_ptr = CreateHomeButton();
ConfigureChildView(home_button_ptr.get());
home_button_ = AddChildView(std::move(home_button_ptr));
home_button_->set_context_menu_controller(this);
@@ -378,7 +378,7 @@
gfx::Rect ShelfView::GetIdealBoundsOfItemIcon(const ShelfID& id) {
if (id == ShelfID(kAppListId))
- return GetMirroredRect(GetAppListButton()->ideal_bounds());
+ return GetMirroredRect(GetHomeButton()->ideal_bounds());
if (id == ShelfID(kBackButtonId))
return GetMirroredRect(GetBackButton()->ideal_bounds());
@@ -416,7 +416,7 @@
return overflow_bubble_.get() && overflow_bubble_->IsShowing();
}
-AppListButton* ShelfView::GetAppListButton() const {
+HomeButton* ShelfView::GetHomeButton() const {
return home_button_;
}
@@ -444,21 +444,21 @@
}
bool ShelfView::ShouldHideTooltip(const gfx::Point& cursor_location) const {
- // If this is the app list button, only show the tooltip if the app list is
+ // If this is the home button, only show the tooltip if the app list is
// not already showing.
- const AppListButton* app_list_button = GetAppListButton();
- if (app_list_button &&
- app_list_button->GetMirroredBounds().Contains(cursor_location)) {
- return app_list_button->IsShowingAppList();
+ const HomeButton* home_button = GetHomeButton();
+ if (home_button &&
+ home_button->GetMirroredBounds().Contains(cursor_location)) {
+ return home_button->IsShowingAppList();
}
return !visible_shelf_item_bounds_union_.Contains(cursor_location);
}
bool ShelfView::ShouldShowTooltipForView(const views::View* view) const {
- // If this is the app list button, only show the tooltip if the app list is
+ // If this is the home button, only show the tooltip if the app list is
// not already showing.
- if (view == GetAppListButton())
- return !GetAppListButton()->IsShowingAppList();
+ if (view == GetHomeButton())
+ return !GetHomeButton()->IsShowingAppList();
if (view == overflow_button_)
return true;
// Don't show a tooltip for a view that's currently being dragged.
@@ -516,10 +516,10 @@
if (model_->item_count() == 0) {
// There are no apps.
return shelf_->IsHorizontalAlignment()
- ? gfx::Size(GetAppListButton()->bounds().right(),
+ ? gfx::Size(GetHomeButton()->bounds().right(),
ShelfConstants::shelf_size())
: gfx::Size(ShelfConstants::shelf_size(),
- GetAppListButton()->bounds().bottom());
+ GetHomeButton()->bounds().bottom());
}
int last_button_index = last_visible_index_;
@@ -632,13 +632,13 @@
return;
}
- if (sender == GetAppListButton()) {
+ if (sender == GetHomeButton()) {
Shell::Get()->metrics()->RecordUserMetricsAction(
UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON);
const app_list::AppListShowSource show_source =
event.IsShiftDown() ? app_list::kShelfButtonFullscreen
: app_list::kShelfButton;
- GetAppListButton()->OnPressed(show_source, event.time_stamp());
+ GetHomeButton()->OnPressed(show_source, event.time_stamp());
return;
}
@@ -858,14 +858,14 @@
if (is_overflow_mode())
return main_shelf()->FindFirstFocusableChild();
return IsTabletModeEnabled() ? static_cast<views::View*>(GetBackButton())
- : static_cast<views::View*>(GetAppListButton());
+ : static_cast<views::View*>(GetHomeButton());
}
views::View* ShelfView::FindLastFocusableChild() {
if (IsShowingOverflowBubble())
return overflow_shelf()->FindLastFocusableChild();
if (view_model_->view_size() == 0)
- return static_cast<views::View*>(GetAppListButton());
+ return static_cast<views::View*>(GetHomeButton());
return overflow_button_->GetVisible()
? overflow_button_
: view_model_->view_at(last_visible_index());
@@ -1041,7 +1041,7 @@
// The back and app buttons are not part of the view model, treat them
// separately.
- if (view == GetAppListButton() || view == GetBackButton())
+ if (view == GetHomeButton() || view == GetBackButton())
return !repost;
// Ignore if this is a repost event on the last pressed shelf item.
@@ -1103,7 +1103,7 @@
return; // View is being deleted, ignore request.
// The home and back buttons should be handled separately.
- DCHECK(view != GetAppListButton() || view != GetBackButton());
+ DCHECK(view != GetHomeButton() || view != GetBackButton());
// Only when the repost event occurs on the same shelf item, we should ignore
// the call in ShelfView::ButtonPressed(...).
@@ -1214,7 +1214,7 @@
// Handle back and home separately.
ShelfControlButton* back = GetBackButton();
bounds_animator_->AnimateViewTo(back, back->ideal_bounds());
- ShelfControlButton* home = GetAppListButton();
+ ShelfControlButton* home = GetHomeButton();
bounds_animator_->AnimateViewTo(home, home->ideal_bounds());
if (home->border())
home->SetBorder(views::NullBorder());
@@ -1632,7 +1632,7 @@
bool ShelfView::ShouldFocusOut(bool reverse, views::View* button) {
// The logic here seems backwards, but is actually correct. For instance if
// the ShelfView's internal focus cycling logic attemmpts to focus the first
- // child (e.g. app list button) after hitting Tab, we intercept that and
+ // child (e.g. home button) after hitting Tab, we intercept that and
// instead, advance through to the status area.
return (reverse && button == FindLastFocusableChild()) ||
(!reverse && button == FindFirstFocusableChild());
@@ -2048,10 +2048,10 @@
tooltip_.Close();
if (overflow_bubble_)
overflow_bubble_->Hide();
- // For crbug.com/587931, because AppListButton layout logic is in OnPaint.
- AppListButton* app_list_button = GetAppListButton();
- if (app_list_button)
- app_list_button->SchedulePaint();
+ // For crbug.com/587931, because HomeButton layout logic is in OnPaint.
+ HomeButton* home_button = GetHomeButton();
+ if (home_button)
+ home_button->SchedulePaint();
AnnounceShelfAlignment();
}
diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h
index 9eebf2a..fe0ea61b 100644
--- a/ash/shelf/shelf_view.h
+++ b/ash/shelf/shelf_view.h
@@ -47,7 +47,7 @@
} // namespace views
namespace ash {
-class AppListButton;
+class HomeButton;
class BackButton;
class DragImageView;
class OverflowBubble;
@@ -151,7 +151,7 @@
void set_focused_button(ShelfButton* focused) { focused_button_ = focused; }
- AppListButton* GetAppListButton() const;
+ HomeButton* GetHomeButton() const;
BackButton* GetBackButton() const;
OverflowButton* GetOverflowButton() const;
@@ -270,7 +270,7 @@
// The three methods below return the first or last focusable child of the
// set including both the main shelf and the overflow shelf it it's showing.
- // - The first focusable child is either the app list button, or the back
+ // - The first focusable child is either the home button, or the back
// button in tablet mode.
// - The last focusable child can be either 1) the last app icon on the main
// shelf if there aren't enough apps to overflow, 2) the overflow button
@@ -341,7 +341,7 @@
virtual views::View* CreateViewForItem(const ShelfItem& item);
virtual std::unique_ptr<BackButton> CreateBackButton() = 0;
- virtual std::unique_ptr<AppListButton> CreateHomeButton() = 0;
+ virtual std::unique_ptr<HomeButton> CreateHomeButton() = 0;
// Lays out control buttons background.
// Child classes should implement this method if control buttons background
@@ -567,7 +567,7 @@
std::unique_ptr<views::BoundsAnimator> bounds_animator_;
BackButton* back_button_ = nullptr;
- AppListButton* home_button_ = nullptr;
+ HomeButton* home_button_ = nullptr;
OverflowButton* overflow_button_ = nullptr;
std::unique_ptr<OverflowBubble> overflow_bubble_;
diff --git a/ash/shelf/shelf_view_test_api.h b/ash/shelf/shelf_view_test_api.h
index ac633791..d3f6712a 100644
--- a/ash/shelf/shelf_view_test_api.h
+++ b/ash/shelf/shelf_view_test_api.h
@@ -34,8 +34,8 @@
// Number of icons displayed.
int GetButtonCount();
- // Retrieve the button at |index|, doesn't support the app list button,
- // because the app list button is not a ShelfAppButton.
+ // Retrieve the button at |index|, doesn't support the home button,
+ // because the home button is not a ShelfAppButton.
ShelfAppButton* GetButton(int index);
// Retrieve the view at |index|.
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index a29bec4..2d616439 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -27,8 +27,8 @@
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
#include "ash/session/session_controller_impl.h"
-#include "ash/shelf/app_list_button.h"
#include "ash/shelf/back_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/overflow_bubble.h"
#include "ash/shelf/overflow_bubble_view.h"
#include "ash/shelf/overflow_bubble_view_test_api.h"
@@ -390,7 +390,7 @@
}
// Similar to SimulateViewPressed, but the index must not be for the app list,
- // since the app list button is not a ShelfAppButton.
+ // since the home button is not a ShelfAppButton.
ShelfAppButton* SimulateButtonPressed(ShelfView::Pointer pointer,
int button_index) {
ShelfAppButton* button = test_api_->GetButton(button_index);
@@ -723,7 +723,7 @@
const gfx::Rect bounds_3 = shelf_view_->GetIdealBoundsOfItemIcon(id_3);
EXPECT_EQ(shelf_view_->GetIdealBoundsOfItemIcon(ShelfID(kAppListId)),
- shelf_view_->GetAppListButton()->GetMirroredBounds());
+ shelf_view_->GetHomeButton()->GetMirroredBounds());
EXPECT_EQ(shelf_view_->GetIdealBoundsOfItemIcon(ShelfID(kBackButtonId)),
shelf_view_->GetBackButton()->GetMirroredBounds());
@@ -1339,7 +1339,7 @@
TEST_F(ShelfViewTest, ButtonTitlesTest) {
AddButtonsUntilOverflow();
EXPECT_EQ(base::UTF8ToUTF16("Launcher"),
- shelf_view_->GetAppListButton()->GetAccessibleName());
+ shelf_view_->GetHomeButton()->GetAccessibleName());
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_SHELF_BACK_BUTTON_TITLE),
shelf_view_->GetBackButton()->GetAccessibleName());
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_SHELF_OVERFLOW_NAME),
@@ -1402,10 +1402,10 @@
// |AddItem| call seems to sometimes be missing some re-layout steps. We
// should find out what's going on there.
shelf_view_->UpdateVisibleShelfItemBoundsUnion();
- const AppListButton* app_list_button = shelf_view_->GetAppListButton();
+ const HomeButton* home_button = shelf_view_->GetHomeButton();
// Make sure we're not showing the app list.
- EXPECT_FALSE(app_list_button->IsShowingAppList())
+ EXPECT_FALSE(home_button->IsShowingAppList())
<< "We should not be showing the app list";
// The tooltip shouldn't hide if the mouse is on normal buttons.
@@ -1418,10 +1418,10 @@
<< "ShelfView tries to hide on button " << i;
}
- // The tooltip should hide if placed in between the app list button and the
+ // The tooltip should hide if placed in between the home button and the
// first shelf button.
- const int left = app_list_button->bounds().right();
- // Find the first shelf button that's to the right of the app list button.
+ const int left = home_button->bounds().right();
+ // Find the first shelf button that's to the right of the home button.
int right = 0;
for (int i = 0; i < test_api_->GetButtonCount(); ++i) {
ShelfAppButton* button = test_api_->GetButton(i);
@@ -1433,13 +1433,13 @@
}
const int center_x =
shelf_view_->GetMirroredXInView(left + (right - left) / 2);
- EXPECT_TRUE(shelf_view_->ShouldHideTooltip(gfx::Point(
- center_x, app_list_button->GetMirroredBounds().left_center().y())))
- << "Tooltip should hide between app list button and first shelf item";
+ EXPECT_TRUE(shelf_view_->ShouldHideTooltip(
+ gfx::Point(center_x, home_button->GetMirroredBounds().left_center().y())))
+ << "Tooltip should hide between home button and first shelf item";
// The tooltip should not hide on the app-list button.
EXPECT_FALSE(shelf_view_->ShouldHideTooltip(
- app_list_button->GetMirroredBounds().CenterPoint()));
+ home_button->GetMirroredBounds().CenterPoint()));
// The tooltip shouldn't hide if the mouse is in the gap between two buttons.
gfx::Rect app_button_rect = GetButtonByID(app_button_id)->GetMirroredBounds();
@@ -1458,7 +1458,7 @@
all_area.Union(button->GetMirroredBounds());
}
- all_area.Union(shelf_view_->GetAppListButton()->GetMirroredBounds());
+ all_area.Union(shelf_view_->GetHomeButton()->GetMirroredBounds());
EXPECT_FALSE(shelf_view_->ShouldHideTooltip(all_area.origin()));
EXPECT_FALSE(shelf_view_->ShouldHideTooltip(
gfx::Point(all_area.right() - 1, all_area.bottom() - 1)));
@@ -1487,10 +1487,10 @@
<< "ShelfView tries to hide on button " << i;
}
- // The tooltip should hide on the app list button if the app list is visible.
- AppListButton* app_list_button = shelf_view_->GetAppListButton();
+ // The tooltip should hide on the home button if the app list is visible.
+ HomeButton* home_button = shelf_view_->GetHomeButton();
EXPECT_TRUE(shelf_view_->ShouldHideTooltip(
- app_list_button->GetMirroredBounds().CenterPoint()));
+ home_button->GetMirroredBounds().CenterPoint()));
}
// Test that by moving the mouse cursor off the button onto the bubble it closes
@@ -1505,8 +1505,8 @@
EXPECT_FALSE(tooltip_manager->IsVisible());
// Move the mouse over the button and check that it is visible.
- AppListButton* app_list_button = shelf_view_->GetAppListButton();
- gfx::Rect bounds = app_list_button->GetBoundsInScreen();
+ HomeButton* home_button = shelf_view_->GetHomeButton();
+ gfx::Rect bounds = home_button->GetBoundsInScreen();
generator->MoveMouseTo(bounds.CenterPoint());
// Wait for the timer to go off.
base::RunLoop().RunUntilIdle();
@@ -1533,7 +1533,7 @@
}
// Resizing shelf view while an add animation without fade-in is running,
-// which happens when overflow happens. App list button should end up in its
+// which happens when overflow happens. Home button should end up in its
// new ideal bounds.
TEST_F(ShelfViewTest, ResizeDuringOverflowAddAnimation) {
// All buttons should be visible.
@@ -1559,12 +1559,12 @@
// Finish the animation.
test_api_->RunMessageLoopUntilAnimationsDone();
- // App list button should ends up in its new ideal bounds.
- const int app_list_button_index = test_api_->GetButtonCount() - 1;
+ // Home button should ends up in its new ideal bounds.
+ const int home_button_index = test_api_->GetButtonCount() - 1;
const gfx::Rect& app_list_ideal_bounds =
- test_api_->GetIdealBoundsByIndex(app_list_button_index);
+ test_api_->GetIdealBoundsByIndex(home_button_index);
const gfx::Rect& app_list_bounds =
- test_api_->GetBoundsByIndex(app_list_button_index);
+ test_api_->GetBoundsByIndex(home_button_index);
EXPECT_EQ(app_list_ideal_bounds, app_list_bounds);
}
@@ -2109,7 +2109,7 @@
// Enable tablet mode to show the back button. Wait for tablet mode animations
// to finish in order for the BackButton to move out from under the
- // AppListButton.
+ // HomeButton.
Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
test_api_->RunMessageLoopUntilAnimationsDone();
@@ -2238,11 +2238,11 @@
EXPECT_EQ(first_app_id, model_->items()[last_index].id);
}
-// Tests that the app list button does shows a context menu on right click.
-TEST_F(ShelfViewTest, AppListButtonDoesShowContextMenu) {
+// Tests that the home button does shows a context menu on right click.
+TEST_F(ShelfViewTest, HomeButtonDoesShowContextMenu) {
ui::test::EventGenerator* generator = GetEventGenerator();
- const AppListButton* app_list_button = shelf_view_->GetAppListButton();
- generator->MoveMouseTo(app_list_button->GetBoundsInScreen().CenterPoint());
+ const HomeButton* home_button = shelf_view_->GetHomeButton();
+ generator->MoveMouseTo(home_button->GetBoundsInScreen().CenterPoint());
generator->PressRightButton();
EXPECT_TRUE(test_api_->CloseMenu());
}
@@ -2305,11 +2305,11 @@
EXPECT_TRUE(shelf_view_->GetOverflowButton()->GetVisible());
// Now that the apps + overflow button are centered over the available space
// on the shelf, check that the the distance between the left app and the
- // app list button is equal to the distance between the overflow button
+ // home button is equal to the distance between the overflow button
// and the status area.
ExpectWithinOnePixel(
app_buttons[0]->GetBoundsInScreen().x() -
- shelf_view_->GetAppListButton()->GetBoundsInScreen().right(),
+ shelf_view_->GetHomeButton()->GetBoundsInScreen().right(),
status_area_->GetBoundsInScreen().x() -
shelf_view_->GetOverflowButton()->GetBoundsInScreen().right());
}
@@ -2532,14 +2532,14 @@
if (button->GetVisible())
EXPECT_TRUE(visible_bounds.Contains(button->GetBoundsInScreen()));
}
- CheckAppListButtonIsInBounds();
+ CheckHomeButtonIsInBounds();
}
- void CheckAppListButtonIsInBounds() {
+ void CheckHomeButtonIsInBounds() {
gfx::Rect visible_bounds = shelf_view_->GetVisibleItemsBoundsInScreen();
- gfx::Rect app_list_button_bounds =
- shelf_view_->GetAppListButton()->GetBoundsInScreen();
- EXPECT_TRUE(visible_bounds.Contains(app_list_button_bounds));
+ gfx::Rect home_button_bounds =
+ shelf_view_->GetHomeButton()->GetBoundsInScreen();
+ EXPECT_TRUE(visible_bounds.Contains(home_button_bounds));
}
private:
@@ -2671,15 +2671,15 @@
}
protected:
- void InitAppListButtonInkDrop() {
- app_list_button_ = shelf_view_->GetAppListButton();
+ void InitHomeButtonInkDrop() {
+ home_button_ = shelf_view_->GetHomeButton();
- auto app_list_button_ink_drop =
+ auto home_button_ink_drop =
std::make_unique<InkDropSpy>(std::make_unique<views::InkDropImpl>(
- app_list_button_, app_list_button_->size()));
- app_list_button_ink_drop_ = app_list_button_ink_drop.get();
- views::test::InkDropHostViewTestApi(app_list_button_)
- .SetInkDrop(std::move(app_list_button_ink_drop), false);
+ home_button_, home_button_->size()));
+ home_button_ink_drop_ = home_button_ink_drop.get();
+ views::test::InkDropHostViewTestApi(home_button_)
+ .SetInkDrop(std::move(home_button_ink_drop), false);
}
void InitBrowserButtonInkDrop() {
@@ -2693,8 +2693,8 @@
.SetInkDrop(std::move(browser_button_ink_drop));
}
- AppListButton* app_list_button_ = nullptr;
- InkDropSpy* app_list_button_ink_drop_ = nullptr;
+ HomeButton* home_button_ = nullptr;
+ InkDropSpy* home_button_ink_drop_ = nullptr;
ShelfAppButton* browser_button_ = nullptr;
InkDropSpy* browser_button_ink_drop_ = nullptr;
@@ -2702,34 +2702,34 @@
DISALLOW_COPY_AND_ASSIGN(ShelfViewInkDropTest);
};
-// Tests that changing visibility of the app list transitions app list button's
+// Tests that changing visibility of the app list transitions home button's
// ink drop states correctly.
-TEST_F(ShelfViewInkDropTest, AppListButtonWhenVisibilityChanges) {
- InitAppListButtonInkDrop();
+TEST_F(ShelfViewInkDropTest, HomeButtonWhenVisibilityChanges) {
+ InitHomeButtonInkDrop();
GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplayId());
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTIVATED));
GetAppListTestHelper()->DismissAndRunLoop();
EXPECT_EQ(views::InkDropState::HIDDEN,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::DEACTIVATED));
}
-// Tests that when the app list is hidden, mouse press on the app list button,
+// Tests that when the app list is hidden, mouse press on the home button,
// which shows the app list, transitions ink drop states correctly. Also, tests
// that mouse drag and mouse release does not affect the ink drop state.
-TEST_F(ShelfViewInkDropTest, AppListButtonMouseEventsWhenHidden) {
- InitAppListButtonInkDrop();
+TEST_F(ShelfViewInkDropTest, HomeButtonMouseEventsWhenHidden) {
+ InitHomeButtonInkDrop();
ui::test::EventGenerator* generator = GetEventGenerator();
- generator->MoveMouseTo(app_list_button_->GetBoundsInScreen().CenterPoint());
+ generator->MoveMouseTo(home_button_->GetBoundsInScreen().CenterPoint());
// Mouse press on the button, which shows the app list, should end up in the
// activated state.
@@ -2737,71 +2737,69 @@
GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplayId());
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTION_PENDING,
views::InkDropState::ACTIVATED));
// Dragging mouse out and back and releasing the button should not change the
// ink drop state.
- generator->MoveMouseBy(app_list_button_->width(), 0);
- generator->MoveMouseBy(-app_list_button_->width(), 0);
+ generator->MoveMouseBy(home_button_->width(), 0);
+ generator->MoveMouseBy(-home_button_->width(), 0);
generator->ReleaseLeftButton();
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
- IsEmpty());
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(), IsEmpty());
}
-// Tests that when the app list is visible, mouse press on the app list button,
+// Tests that when the app list is visible, mouse press on the home button,
// which dismisses the app list, transitions ink drop states correctly. Also,
// tests that mouse drag and mouse release does not affect the ink drop state.
-TEST_F(ShelfViewInkDropTest, AppListButtonMouseEventsWhenVisible) {
- InitAppListButtonInkDrop();
+TEST_F(ShelfViewInkDropTest, HomeButtonMouseEventsWhenVisible) {
+ InitHomeButtonInkDrop();
GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplayId());
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTIVATED));
// Mouse press on the button, which dismisses the app list, should end up in
// the hidden state.
ui::test::EventGenerator* generator = GetEventGenerator();
- generator->MoveMouseTo(app_list_button_->GetBoundsInScreen().CenterPoint());
+ generator->MoveMouseTo(home_button_->GetBoundsInScreen().CenterPoint());
generator->PressLeftButton();
base::RunLoop().RunUntilIdle();
EXPECT_EQ(views::InkDropState::HIDDEN,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTION_PENDING,
views::InkDropState::DEACTIVATED,
views::InkDropState::HIDDEN));
// Dragging mouse out and back and releasing the button should not change the
// ink drop state.
- generator->MoveMouseBy(app_list_button_->width(), 0);
- generator->MoveMouseBy(-app_list_button_->width(), 0);
+ generator->MoveMouseBy(home_button_->width(), 0);
+ generator->MoveMouseBy(-home_button_->width(), 0);
generator->ReleaseLeftButton();
EXPECT_EQ(views::InkDropState::HIDDEN,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
- IsEmpty());
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(), IsEmpty());
}
-// Tests that when the app list is hidden, tapping on the app list button
+// Tests that when the app list is hidden, tapping on the home button
// transitions ink drop states correctly.
-TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapWhenHidden) {
- InitAppListButtonInkDrop();
+TEST_F(ShelfViewInkDropTest, HomeButtonGestureTapWhenHidden) {
+ InitHomeButtonInkDrop();
ui::test::EventGenerator* generator = GetEventGenerator();
- generator->MoveMouseTo(app_list_button_->GetBoundsInScreen().CenterPoint());
+ generator->MoveMouseTo(home_button_->GetBoundsInScreen().CenterPoint());
// Touch press on the button should end up in the pending state.
generator->PressTouch();
EXPECT_EQ(views::InkDropState::ACTION_PENDING,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTION_PENDING));
// Touch release on the button, which shows the app list, should end up in the
@@ -2810,111 +2808,105 @@
GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplayId());
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTION_TRIGGERED,
views::InkDropState::ACTIVATED));
}
-// Tests that when the app list is visible, tapping on the app list button
+// Tests that when the app list is visible, tapping on the home button
// transitions ink drop states correctly.
-TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapWhenVisible) {
- InitAppListButtonInkDrop();
+TEST_F(ShelfViewInkDropTest, HomeButtonGestureTapWhenVisible) {
+ InitHomeButtonInkDrop();
GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplayId());
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTIVATED));
// Touch press and release on the button, which dismisses the app list, should
// end up in the hidden state.
ui::test::EventGenerator* generator = GetEventGenerator();
- generator->MoveMouseTo(app_list_button_->GetBoundsInScreen().CenterPoint());
+ generator->MoveMouseTo(home_button_->GetBoundsInScreen().CenterPoint());
generator->PressTouch();
generator->ReleaseTouch();
GetAppListTestHelper()->WaitUntilIdle();
EXPECT_EQ(views::InkDropState::HIDDEN,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::DEACTIVATED,
views::InkDropState::HIDDEN));
}
-// Tests that when the app list is hidden, tapping down on the app list button
+// Tests that when the app list is hidden, tapping down on the home button
// and dragging the touch point transitions ink drop states correctly.
-TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapDragWhenHidden) {
- InitAppListButtonInkDrop();
+TEST_F(ShelfViewInkDropTest, HomeButtonGestureTapDragWhenHidden) {
+ InitHomeButtonInkDrop();
ui::test::EventGenerator* generator = GetEventGenerator();
- gfx::Point touch_location =
- app_list_button_->GetBoundsInScreen().CenterPoint();
+ gfx::Point touch_location = home_button_->GetBoundsInScreen().CenterPoint();
generator->MoveMouseTo(touch_location);
// Touch press on the button should end up in the pending state.
generator->PressTouch();
EXPECT_EQ(views::InkDropState::ACTION_PENDING,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTION_PENDING));
// Dragging the touch point should hide the pending ink drop.
- touch_location.Offset(app_list_button_->width(), 0);
+ touch_location.Offset(home_button_->width(), 0);
generator->MoveTouch(touch_location);
EXPECT_EQ(views::InkDropState::HIDDEN,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTION_TRIGGERED));
// Touch release should not change the ink drop state.
generator->ReleaseTouch();
EXPECT_EQ(views::InkDropState::HIDDEN,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
- IsEmpty());
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(), IsEmpty());
}
-// Tests that when the app list is visible, tapping down on the app list button
+// Tests that when the app list is visible, tapping down on the home button
// and dragging the touch point will not change ink drop states.
-TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapDragWhenVisible) {
- InitAppListButtonInkDrop();
+TEST_F(ShelfViewInkDropTest, HomeButtonGestureTapDragWhenVisible) {
+ InitHomeButtonInkDrop();
GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplayId());
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(),
ElementsAre(views::InkDropState::ACTIVATED));
// Touch press on the button, dragging the touch point, and releasing, which
// will not dismisses the app list, should end up in the |ACTIVATED| state.
ui::test::EventGenerator* generator = GetEventGenerator();
- gfx::Point touch_location =
- app_list_button_->GetBoundsInScreen().CenterPoint();
+ gfx::Point touch_location = home_button_->GetBoundsInScreen().CenterPoint();
generator->MoveMouseTo(touch_location);
// Touch press on the button should not change the ink drop state.
generator->PressTouch();
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
- IsEmpty());
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(), IsEmpty());
// Dragging the touch point should not hide the pending ink drop.
- touch_location.Offset(app_list_button_->width(), 0);
+ touch_location.Offset(home_button_->width(), 0);
generator->MoveTouch(touch_location);
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
- IsEmpty());
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(), IsEmpty());
// Touch release should not change the ink drop state.
generator->ReleaseTouch();
EXPECT_EQ(views::InkDropState::ACTIVATED,
- app_list_button_ink_drop_->GetTargetInkDropState());
- EXPECT_THAT(app_list_button_ink_drop_->GetAndResetRequestedStates(),
- IsEmpty());
+ home_button_ink_drop_->GetTargetInkDropState());
+ EXPECT_THAT(home_button_ink_drop_->GetAndResetRequestedStates(), IsEmpty());
}
// Tests that clicking on a shelf item that does not show a menu transitions ink
@@ -3081,9 +3073,9 @@
views::Button* button = browser_button_;
- // Show a context menu on the app list button.
+ // Show a context menu on the home button.
generator->MoveMouseTo(
- shelf_view_->GetAppListButton()->GetBoundsInScreen().CenterPoint());
+ shelf_view_->GetHomeButton()->GetBoundsInScreen().CenterPoint());
generator->PressRightButton();
generator->ReleaseRightButton();
EXPECT_TRUE(shelf_view_->IsShowingMenu());
@@ -3606,7 +3598,7 @@
// The home button is focused initially because the back button is only
// visible in tablet mode.
- EXPECT_TRUE(shelf_view_->GetAppListButton()->HasFocus());
+ EXPECT_TRUE(shelf_view_->GetHomeButton()->HasFocus());
}
// Tests that the expected views have focus when cycling through shelf items
@@ -3627,7 +3619,7 @@
TEST_F(ShelfViewFocusTest, BackwardCycling) {
// The first element is currently focused. Let's advance to the last element
// first.
- EXPECT_TRUE(shelf_view_->GetAppListButton()->HasFocus());
+ EXPECT_TRUE(shelf_view_->GetHomeButton()->HasFocus());
DoTab();
DoTab();
DoTab();
@@ -3651,7 +3643,7 @@
// Verifies that focus moves as expected between the shelf and the status area.
TEST_F(ShelfViewFocusTest, FocusCyclingBetweenShelfAndStatusWidget) {
// The first element of the shelf (the home button) is focused at start.
- EXPECT_TRUE(shelf_view_->GetAppListButton()->HasFocus());
+ EXPECT_TRUE(shelf_view_->GetHomeButton()->HasFocus());
// Focus the next few elements.
DoTab();
@@ -3680,7 +3672,7 @@
// And keep going forward, now we should be cycling back to the first shelf
// element.
DoTab();
- EXPECT_TRUE(shelf_view_->GetAppListButton()->HasFocus());
+ EXPECT_TRUE(shelf_view_->GetHomeButton()->HasFocus());
ExpectNotFocused(status_area_);
}
@@ -3731,14 +3723,14 @@
EXPECT_EQ(last_item_on_main_shelf_index_, items_ - 5);
EXPECT_TRUE(shelf_view_->shelf_widget()->IsActive());
- EXPECT_TRUE(shelf_view_->GetAppListButton()->HasFocus());
+ EXPECT_TRUE(shelf_view_->GetHomeButton()->HasFocus());
}
TEST_F(ShelfViewOverflowFocusTest, OpenOverflow) {
OpenOverflow();
ASSERT_TRUE(overflow_shelf_test_api_);
EXPECT_TRUE(shelf_view_->IsShowingOverflowBubble());
- EXPECT_TRUE(shelf_view_->GetAppListButton()->HasFocus());
+ EXPECT_TRUE(shelf_view_->GetHomeButton()->HasFocus());
}
// Tests that when cycling through the items with tab, the items in the overflow
@@ -3845,7 +3837,7 @@
// Focus the shelf again.
DoTab();
ExpectFocused(shelf_view_);
- EXPECT_TRUE(shelf_view_->GetAppListButton()->HasFocus());
+ EXPECT_TRUE(shelf_view_->GetHomeButton()->HasFocus());
ExpectNotFocused(status_area_);
// Now advance to the last item on the main shelf.
@@ -3883,7 +3875,7 @@
while (status_area_->GetWidget()->IsActive())
DoTab();
// This should have brought focus to the first element on the shelf.
- EXPECT_TRUE(shelf_view_->GetAppListButton()->HasFocus());
+ EXPECT_TRUE(shelf_view_->GetHomeButton()->HasFocus());
}
class KioskNextShelfViewTest : public ShelfViewTest {
@@ -3937,7 +3929,7 @@
Shell::Get()->kiosk_next_shell_controller()->shelf_model());
// The home and back buttons are always visible.
- EXPECT_TRUE(shelf_view_->GetAppListButton()->GetVisible());
+ EXPECT_TRUE(shelf_view_->GetHomeButton()->GetVisible());
EXPECT_TRUE(shelf_view_->GetBackButton()->GetVisible());
ASSERT_FALSE(shelf_view_->GetOverflowButton()->GetVisible());
@@ -3992,7 +3984,7 @@
EXPECT_TRUE(expected_button_area_bounds.Contains(back_button_bounds));
const gfx::Rect home_button_bounds =
- shelf_view_->GetAppListButton()->ideal_bounds();
+ shelf_view_->GetHomeButton()->ideal_bounds();
EXPECT_FALSE(home_button_bounds.IsEmpty());
EXPECT_TRUE(expected_button_area_bounds.Contains(home_button_bounds));
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc
index 5c7afd1..56332e1 100644
--- a/ash/shelf/shelf_widget.cc
+++ b/ash/shelf/shelf_widget.cc
@@ -16,8 +16,8 @@
#include "ash/public/cpp/window_properties.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller_impl.h"
-#include "ash/shelf/app_list_button.h"
#include "ash/shelf/default_shelf_view.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/kiosk_next_shelf_view.h"
#include "ash/shelf/login_shelf_view.h"
#include "ash/shelf/overflow_bubble.h"
@@ -453,7 +453,7 @@
}
bool ShelfWidget::IsShowingAppList() const {
- return GetAppListButton() && GetAppListButton()->IsShowingAppList();
+ return GetHomeButton() && GetHomeButton()->IsShowingAppList();
}
bool ShelfWidget::IsShowingMenu() const {
@@ -488,8 +488,8 @@
bounds.height());
}
-AppListButton* ShelfWidget::GetAppListButton() const {
- return shelf_view_->GetAppListButton();
+HomeButton* ShelfWidget::GetHomeButton() const {
+ return shelf_view_->GetHomeButton();
}
BackButton* ShelfWidget::GetBackButton() const {
diff --git a/ash/shelf/shelf_widget.h b/ash/shelf/shelf_widget.h
index 35c993c12..fd0ab4b 100644
--- a/ash/shelf/shelf_widget.h
+++ b/ash/shelf/shelf_widget.h
@@ -23,7 +23,7 @@
namespace ash {
enum class AnimationChangeType;
-class AppListButton;
+class HomeButton;
class BackButton;
class FocusCycler;
class LoginShelfView;
@@ -87,7 +87,7 @@
gfx::Rect GetScreenBoundsOfItemIconForWindow(aura::Window* window);
// Returns the button that opens the app launcher.
- AppListButton* GetAppListButton() const;
+ HomeButton* GetHomeButton() const;
// Returns the browser back button.
BackButton* GetBackButton() const;
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
index a10ca99..91e3293 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
@@ -12,7 +12,7 @@
#include "ash/public/cpp/shelf_item_delegate.h"
#include "ash/public/cpp/shelf_model.h"
#include "ash/public/cpp/window_properties.h"
-#include "ash/shelf/app_list_button.h"
+#include "ash/shelf/home_button.h"
#include "ash/shelf/overflow_button.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_app_button.h"