Commit 6da4ffab authored by tfarina@chromium.org's avatar tfarina@chromium.org

ash: Rename LauncherButtonHost to ShelfButtonHost.

- move launcher_button_host.h from launcher/ to shelf/
- rename to shelf_button_host.h

BUG=248353
TEST=None, no functional changes
R=harrym@chromium.org,jamescook@chromium.org

Review URL: https://codereview.chromium.org/57453002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233337 0039d316-1c4b-4281-b951-d872f2087c98
parent 006f475c
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
'shelf/shelf_alignment_menu.h', 'shelf/shelf_alignment_menu.h',
'shelf/shelf_bezel_event_filter.cc', 'shelf/shelf_bezel_event_filter.cc',
'shelf/shelf_bezel_event_filter.h', 'shelf/shelf_bezel_event_filter.h',
'shelf/shelf_button_host.h',
'shelf/shelf_icon_observer.h', 'shelf/shelf_icon_observer.h',
'shelf/shelf_layout_manager.cc', 'shelf/shelf_layout_manager.cc',
'shelf/shelf_layout_manager.h', 'shelf/shelf_layout_manager.h',
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <algorithm> #include <algorithm>
#include "ash/ash_switches.h" #include "ash/ash_switches.h"
#include "ash/launcher/launcher_button_host.h" #include "ash/shelf/shelf_button_host.h"
#include "ash/shelf/shelf_layout_manager.h" #include "ash/shelf/shelf_layout_manager.h"
#include "grit/ash_resources.h" #include "grit/ash_resources.h"
#include "skia/ext/image_operations.h" #include "skia/ext/image_operations.h"
...@@ -221,7 +221,7 @@ bool LauncherButton::IconView::HitTestRect(const gfx::Rect& rect) const { ...@@ -221,7 +221,7 @@ bool LauncherButton::IconView::HitTestRect(const gfx::Rect& rect) const {
LauncherButton* LauncherButton::Create( LauncherButton* LauncherButton::Create(
views::ButtonListener* listener, views::ButtonListener* listener,
LauncherButtonHost* host, ShelfButtonHost* host,
ShelfLayoutManager* shelf_layout_manager) { ShelfLayoutManager* shelf_layout_manager) {
LauncherButton* button = LauncherButton* button =
new LauncherButton(listener, host, shelf_layout_manager); new LauncherButton(listener, host, shelf_layout_manager);
...@@ -230,7 +230,7 @@ LauncherButton* LauncherButton::Create( ...@@ -230,7 +230,7 @@ LauncherButton* LauncherButton::Create(
} }
LauncherButton::LauncherButton(views::ButtonListener* listener, LauncherButton::LauncherButton(views::ButtonListener* listener,
LauncherButtonHost* host, ShelfButtonHost* host,
ShelfLayoutManager* shelf_layout_manager) ShelfLayoutManager* shelf_layout_manager)
: CustomButton(listener), : CustomButton(listener),
host_(host), host_(host),
...@@ -355,24 +355,24 @@ void LauncherButton::ShowContextMenu(const gfx::Point& p, ...@@ -355,24 +355,24 @@ void LauncherButton::ShowContextMenu(const gfx::Point& p,
bool LauncherButton::OnMousePressed(const ui::MouseEvent& event) { bool LauncherButton::OnMousePressed(const ui::MouseEvent& event) {
CustomButton::OnMousePressed(event); CustomButton::OnMousePressed(event);
host_->PointerPressedOnButton(this, LauncherButtonHost::MOUSE, event); host_->PointerPressedOnButton(this, ShelfButtonHost::MOUSE, event);
return true; return true;
} }
void LauncherButton::OnMouseReleased(const ui::MouseEvent& event) { void LauncherButton::OnMouseReleased(const ui::MouseEvent& event) {
CustomButton::OnMouseReleased(event); CustomButton::OnMouseReleased(event);
host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, false); host_->PointerReleasedOnButton(this, ShelfButtonHost::MOUSE, false);
} }
void LauncherButton::OnMouseCaptureLost() { void LauncherButton::OnMouseCaptureLost() {
ClearState(STATE_HOVERED); ClearState(STATE_HOVERED);
host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, true); host_->PointerReleasedOnButton(this, ShelfButtonHost::MOUSE, true);
CustomButton::OnMouseCaptureLost(); CustomButton::OnMouseCaptureLost();
} }
bool LauncherButton::OnMouseDragged(const ui::MouseEvent& event) { bool LauncherButton::OnMouseDragged(const ui::MouseEvent& event) {
CustomButton::OnMouseDragged(event); CustomButton::OnMouseDragged(event);
host_->PointerDraggedOnButton(this, LauncherButtonHost::MOUSE, event); host_->PointerDraggedOnButton(this, ShelfButtonHost::MOUSE, event);
return true; return true;
} }
...@@ -481,16 +481,16 @@ void LauncherButton::OnGestureEvent(ui::GestureEvent* event) { ...@@ -481,16 +481,16 @@ void LauncherButton::OnGestureEvent(ui::GestureEvent* event) {
ClearState(STATE_HOVERED); ClearState(STATE_HOVERED);
return CustomButton::OnGestureEvent(event); return CustomButton::OnGestureEvent(event);
case ui::ET_GESTURE_SCROLL_BEGIN: case ui::ET_GESTURE_SCROLL_BEGIN:
host_->PointerPressedOnButton(this, LauncherButtonHost::TOUCH, *event); host_->PointerPressedOnButton(this, ShelfButtonHost::TOUCH, *event);
event->SetHandled(); event->SetHandled();
return; return;
case ui::ET_GESTURE_SCROLL_UPDATE: case ui::ET_GESTURE_SCROLL_UPDATE:
host_->PointerDraggedOnButton(this, LauncherButtonHost::TOUCH, *event); host_->PointerDraggedOnButton(this, ShelfButtonHost::TOUCH, *event);
event->SetHandled(); event->SetHandled();
return; return;
case ui::ET_GESTURE_SCROLL_END: case ui::ET_GESTURE_SCROLL_END:
case ui::ET_SCROLL_FLING_START: case ui::ET_SCROLL_FLING_START:
host_->PointerReleasedOnButton(this, LauncherButtonHost::TOUCH, false); host_->PointerReleasedOnButton(this, ShelfButtonHost::TOUCH, false);
event->SetHandled(); event->SetHandled();
return; return;
default: default:
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
namespace ash { namespace ash {
namespace internal { namespace internal {
class LauncherButtonHost; class ShelfButtonHost;
class ShelfLayoutManager; class ShelfLayoutManager;
// Button used for items on the launcher, except for the AppList. // Button used for items on the launcher, except for the AppList.
...@@ -41,7 +41,7 @@ class ASH_EXPORT LauncherButton : public views::CustomButton { ...@@ -41,7 +41,7 @@ class ASH_EXPORT LauncherButton : public views::CustomButton {
// Called to create an instance of a LauncherButton. // Called to create an instance of a LauncherButton.
static LauncherButton* Create(views::ButtonListener* listener, static LauncherButton* Create(views::ButtonListener* listener,
LauncherButtonHost* host, ShelfButtonHost* host,
ShelfLayoutManager* shelf_layout_manager); ShelfLayoutManager* shelf_layout_manager);
// Sets the image to display for this entry. // Sets the image to display for this entry.
...@@ -70,7 +70,7 @@ class ASH_EXPORT LauncherButton : public views::CustomButton { ...@@ -70,7 +70,7 @@ class ASH_EXPORT LauncherButton : public views::CustomButton {
protected: protected:
LauncherButton(views::ButtonListener* listener, LauncherButton(views::ButtonListener* listener,
LauncherButtonHost* host, ShelfButtonHost* host,
ShelfLayoutManager* shelf_layout_manager); ShelfLayoutManager* shelf_layout_manager);
// Class that draws the icon part of a button, so it can be animated // Class that draws the icon part of a button, so it can be animated
...@@ -118,7 +118,7 @@ class ASH_EXPORT LauncherButton : public views::CustomButton { ...@@ -118,7 +118,7 @@ class ASH_EXPORT LauncherButton : public views::CustomButton {
// Override to subclass IconView. // Override to subclass IconView.
virtual IconView* CreateIconView(); virtual IconView* CreateIconView();
IconView* icon_view() const { return icon_view_; } IconView* icon_view() const { return icon_view_; }
LauncherButtonHost* host() const { return host_; } ShelfButtonHost* host() const { return host_; }
private: private:
class BarView; class BarView;
...@@ -134,7 +134,7 @@ class ASH_EXPORT LauncherButton : public views::CustomButton { ...@@ -134,7 +134,7 @@ class ASH_EXPORT LauncherButton : public views::CustomButton {
// Updates the status bar (bitmap, orientation, visibility). // Updates the status bar (bitmap, orientation, visibility).
void UpdateBar(); void UpdateBar();
LauncherButtonHost* host_; ShelfButtonHost* host_;
IconView* icon_view_; IconView* icon_view_;
// Draws a bar underneath the image to represent the state of the application. // Draws a bar underneath the image to represent the state of the application.
BarView* bar_; BarView* bar_;
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#include "ash/shelf/alternate_app_list_button.h" #include "ash/shelf/alternate_app_list_button.h"
#include "ash/ash_switches.h" #include "ash/ash_switches.h"
#include "ash/launcher/launcher_button_host.h"
#include "ash/launcher/launcher_types.h" #include "ash/launcher/launcher_types.h"
#include "ash/shelf/shelf_button_host.h"
#include "ash/shelf/shelf_layout_manager.h" #include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_widget.h" #include "ash/shelf/shelf_widget.h"
#include "ash/shell.h" #include "ash/shell.h"
...@@ -31,7 +31,7 @@ const int AlternateAppListButton::kImageBoundsSize = 7; ...@@ -31,7 +31,7 @@ const int AlternateAppListButton::kImageBoundsSize = 7;
AlternateAppListButton::AlternateAppListButton(views::ButtonListener* listener, AlternateAppListButton::AlternateAppListButton(views::ButtonListener* listener,
LauncherButtonHost* host, ShelfButtonHost* host,
ShelfWidget* shelf_widget) ShelfWidget* shelf_widget)
: views::ImageButton(listener), : views::ImageButton(listener),
host_(host), host_(host),
...@@ -46,23 +46,23 @@ AlternateAppListButton::~AlternateAppListButton() { ...@@ -46,23 +46,23 @@ AlternateAppListButton::~AlternateAppListButton() {
bool AlternateAppListButton::OnMousePressed(const ui::MouseEvent& event) { bool AlternateAppListButton::OnMousePressed(const ui::MouseEvent& event) {
ImageButton::OnMousePressed(event); ImageButton::OnMousePressed(event);
host_->PointerPressedOnButton(this, LauncherButtonHost::MOUSE, event); host_->PointerPressedOnButton(this, ShelfButtonHost::MOUSE, event);
return true; return true;
} }
void AlternateAppListButton::OnMouseReleased(const ui::MouseEvent& event) { void AlternateAppListButton::OnMouseReleased(const ui::MouseEvent& event) {
ImageButton::OnMouseReleased(event); ImageButton::OnMouseReleased(event);
host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, false); host_->PointerReleasedOnButton(this, ShelfButtonHost::MOUSE, false);
} }
void AlternateAppListButton::OnMouseCaptureLost() { void AlternateAppListButton::OnMouseCaptureLost() {
host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, true); host_->PointerReleasedOnButton(this, ShelfButtonHost::MOUSE, true);
ImageButton::OnMouseCaptureLost(); ImageButton::OnMouseCaptureLost();
} }
bool AlternateAppListButton::OnMouseDragged(const ui::MouseEvent& event) { bool AlternateAppListButton::OnMouseDragged(const ui::MouseEvent& event) {
ImageButton::OnMouseDragged(event); ImageButton::OnMouseDragged(event);
host_->PointerDraggedOnButton(this, LauncherButtonHost::MOUSE, event); host_->PointerDraggedOnButton(this, ShelfButtonHost::MOUSE, event);
return true; return true;
} }
...@@ -84,16 +84,16 @@ void AlternateAppListButton::OnMouseExited(const ui::MouseEvent& event) { ...@@ -84,16 +84,16 @@ void AlternateAppListButton::OnMouseExited(const ui::MouseEvent& event) {
void AlternateAppListButton::OnGestureEvent(ui::GestureEvent* event) { void AlternateAppListButton::OnGestureEvent(ui::GestureEvent* event) {
switch (event->type()) { switch (event->type()) {
case ui::ET_GESTURE_SCROLL_BEGIN: case ui::ET_GESTURE_SCROLL_BEGIN:
host_->PointerPressedOnButton(this, LauncherButtonHost::TOUCH, *event); host_->PointerPressedOnButton(this, ShelfButtonHost::TOUCH, *event);
event->SetHandled(); event->SetHandled();
return; return;
case ui::ET_GESTURE_SCROLL_UPDATE: case ui::ET_GESTURE_SCROLL_UPDATE:
host_->PointerDraggedOnButton(this, LauncherButtonHost::TOUCH, *event); host_->PointerDraggedOnButton(this, ShelfButtonHost::TOUCH, *event);
event->SetHandled(); event->SetHandled();
return; return;
case ui::ET_GESTURE_SCROLL_END: case ui::ET_GESTURE_SCROLL_END:
case ui::ET_SCROLL_FLING_START: case ui::ET_SCROLL_FLING_START:
host_->PointerReleasedOnButton(this, LauncherButtonHost::TOUCH, false); host_->PointerReleasedOnButton(this, ShelfButtonHost::TOUCH, false);
event->SetHandled(); event->SetHandled();
return; return;
default: default:
......
...@@ -13,19 +13,19 @@ class ShelfWidget; ...@@ -13,19 +13,19 @@ class ShelfWidget;
namespace internal { namespace internal {
class LauncherButtonHost; class ShelfButtonHost;
// Button used for the AppList icon on the launcher. // Button used for the AppList icon on the shelf.
// This class is an alternate implementation to // This class is an alternate implementation to ash::internal::AppListButton
// ash::internal::AppListButton for the purposes of testing an // for the purposes of testing an alternate shelf layout
// alternate shelf layout (see ash_switches: UseAlternateShelfLayout). // (see ash_switches: UseAlternateShelfLayout).
class AlternateAppListButton : public views::ImageButton { class AlternateAppListButton : public views::ImageButton {
public: public:
// Bounds size (inset) required for the app icon image (in pixels). // Bounds size (inset) required for the app icon image (in pixels).
static const int kImageBoundsSize; static const int kImageBoundsSize;
AlternateAppListButton(views::ButtonListener* listener, AlternateAppListButton(views::ButtonListener* listener,
LauncherButtonHost* host, ShelfButtonHost* host,
ShelfWidget* shelf_widget); ShelfWidget* shelf_widget);
virtual ~AlternateAppListButton(); virtual ~AlternateAppListButton();
...@@ -45,7 +45,7 @@ class AlternateAppListButton : public views::ImageButton { ...@@ -45,7 +45,7 @@ class AlternateAppListButton : public views::ImageButton {
virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
private: private:
LauncherButtonHost* host_; ShelfButtonHost* host_;
// Reference to the shelf widget containing this button, owned by the // Reference to the shelf widget containing this button, owned by the
// root window controller. // root window controller.
ShelfWidget* shelf_widget_; ShelfWidget* shelf_widget_;
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
#include <vector> #include <vector>
#include "ash/launcher/launcher_button_host.h"
#include "ash/launcher/launcher_types.h" #include "ash/launcher/launcher_types.h"
#include "ash/shelf/shelf_button_host.h"
#include "grit/ash_resources.h" #include "grit/ash_resources.h"
#include "grit/ash_strings.h" #include "grit/ash_strings.h"
#include "ui/base/accessibility/accessible_view_state.h" #include "ui/base/accessibility/accessible_view_state.h"
...@@ -25,7 +25,7 @@ const int kAnimationDurationInMs = 600; ...@@ -25,7 +25,7 @@ const int kAnimationDurationInMs = 600;
const float kAnimationOpacity[] = { 1.0f, 0.4f, 1.0f }; const float kAnimationOpacity[] = { 1.0f, 0.4f, 1.0f };
AppListButton::AppListButton(views::ButtonListener* listener, AppListButton::AppListButton(views::ButtonListener* listener,
LauncherButtonHost* host) ShelfButtonHost* host)
: views::ImageButton(listener), : views::ImageButton(listener),
host_(host) { host_(host) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ResourceBundle& rb = ResourceBundle::GetSharedInstance();
...@@ -86,23 +86,23 @@ void AppListButton::StopLoadingAnimation() { ...@@ -86,23 +86,23 @@ void AppListButton::StopLoadingAnimation() {
bool AppListButton::OnMousePressed(const ui::MouseEvent& event) { bool AppListButton::OnMousePressed(const ui::MouseEvent& event) {
ImageButton::OnMousePressed(event); ImageButton::OnMousePressed(event);
host_->PointerPressedOnButton(this, LauncherButtonHost::MOUSE, event); host_->PointerPressedOnButton(this, ShelfButtonHost::MOUSE, event);
return true; return true;
} }
void AppListButton::OnMouseReleased(const ui::MouseEvent& event) { void AppListButton::OnMouseReleased(const ui::MouseEvent& event) {
ImageButton::OnMouseReleased(event); ImageButton::OnMouseReleased(event);
host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, false); host_->PointerReleasedOnButton(this, ShelfButtonHost::MOUSE, false);
} }
void AppListButton::OnMouseCaptureLost() { void AppListButton::OnMouseCaptureLost() {
host_->PointerReleasedOnButton(this, LauncherButtonHost::MOUSE, true); host_->PointerReleasedOnButton(this, ShelfButtonHost::MOUSE, true);
ImageButton::OnMouseCaptureLost(); ImageButton::OnMouseCaptureLost();
} }
bool AppListButton::OnMouseDragged(const ui::MouseEvent& event) { bool AppListButton::OnMouseDragged(const ui::MouseEvent& event) {
ImageButton::OnMouseDragged(event); ImageButton::OnMouseDragged(event);
host_->PointerDraggedOnButton(this, LauncherButtonHost::MOUSE, event); host_->PointerDraggedOnButton(this, ShelfButtonHost::MOUSE, event);
return true; return true;
} }
......
...@@ -10,13 +10,12 @@ ...@@ -10,13 +10,12 @@
namespace ash { namespace ash {
namespace internal { namespace internal {
class LauncherButtonHost; class ShelfButtonHost;
// Button used for the AppList icon on the launcher. // Button used for the AppList icon on the shelf.
class AppListButton : public views::ImageButton { class AppListButton : public views::ImageButton {
public: public:
AppListButton(views::ButtonListener* listener, AppListButton(views::ButtonListener* listener, ShelfButtonHost* host);
LauncherButtonHost* host);
virtual ~AppListButton(); virtual ~AppListButton();
void StartLoadingAnimation(); void StartLoadingAnimation();
...@@ -34,7 +33,7 @@ class AppListButton : public views::ImageButton { ...@@ -34,7 +33,7 @@ class AppListButton : public views::ImageButton {
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
private: private:
LauncherButtonHost* host_; ShelfButtonHost* host_;
DISALLOW_COPY_AND_ASSIGN(AppListButton); DISALLOW_COPY_AND_ASSIGN(AppListButton);
}; };
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ #ifndef ASH_SHELF_SHELF_BUTTON_HOST_H_
#define ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ #define ASH_SHELF_SHELF_BUTTON_HOST_H_
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
...@@ -19,9 +19,9 @@ class View; ...@@ -19,9 +19,9 @@ class View;
namespace ash { namespace ash {
namespace internal { namespace internal {
// The launcher buttons communicate back to the host by way of this interface. // The shelf buttons communicate back to the host by way of this interface.
// This interface is used to enable reordering the items on the launcher. // This interface is used to enable reordering the items on the shelf.
class ASH_EXPORT LauncherButtonHost { class ASH_EXPORT ShelfButtonHost {
public: public:
enum Pointer { enum Pointer {
NONE, NONE,
...@@ -58,10 +58,10 @@ class ASH_EXPORT LauncherButtonHost { ...@@ -58,10 +58,10 @@ class ASH_EXPORT LauncherButtonHost {
virtual base::string16 GetAccessibleName(const views::View* view) = 0; virtual base::string16 GetAccessibleName(const views::View* view) = 0;
protected: protected:
virtual ~LauncherButtonHost() {} virtual ~ShelfButtonHost() {}
}; };
} // namespace internal } // namespace internal
} // namespace ash } // namespace ash
#endif // ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ #endif // ASH_SHELF_SHELF_BUTTON_HOST_H_
...@@ -633,7 +633,7 @@ bool ShelfView::StartDrag(const std::string& app_id, ...@@ -633,7 +633,7 @@ bool ShelfView::StartDrag(const std::string& app_id,
ui::MouseEvent event(ui::ET_MOUSE_PRESSED, ui::MouseEvent event(ui::ET_MOUSE_PRESSED,
pt, location_in_screen_coordinates, 0); pt, location_in_screen_coordinates, 0);
PointerPressedOnButton( PointerPressedOnButton(
drag_and_drop_view, LauncherButtonHost::DRAG_AND_DROP, event); drag_and_drop_view, ShelfButtonHost::DRAG_AND_DROP, event);
// Drag the item where it really belongs. // Drag the item where it really belongs.
Drag(location_in_screen_coordinates); Drag(location_in_screen_coordinates);
...@@ -652,7 +652,7 @@ bool ShelfView::Drag(const gfx::Point& location_in_screen_coordinates) { ...@@ -652,7 +652,7 @@ bool ShelfView::Drag(const gfx::Point& location_in_screen_coordinates) {
ui::MouseEvent event(ui::ET_MOUSE_DRAGGED, pt, gfx::Point(), 0); ui::MouseEvent event(ui::ET_MOUSE_DRAGGED, pt, gfx::Point(), 0);
PointerDraggedOnButton( PointerDraggedOnButton(
drag_and_drop_view, LauncherButtonHost::DRAG_AND_DROP, event); drag_and_drop_view, ShelfButtonHost::DRAG_AND_DROP, event);
return true; return true;
} }
...@@ -663,7 +663,7 @@ void ShelfView::EndDrag(bool cancel) { ...@@ -663,7 +663,7 @@ void ShelfView::EndDrag(bool cancel) {
views::View* drag_and_drop_view = view_model_->view_at( views::View* drag_and_drop_view = view_model_->view_at(
model_->ItemIndexByID(drag_and_drop_launcher_id_)); model_->ItemIndexByID(drag_and_drop_launcher_id_));
PointerReleasedOnButton( PointerReleasedOnButton(
drag_and_drop_view, LauncherButtonHost::DRAG_AND_DROP, cancel); drag_and_drop_view, ShelfButtonHost::DRAG_AND_DROP, cancel);
// Either destroy the temporarily created item - or - make the item visible. // Either destroy the temporarily created item - or - make the item visible.
if (drag_and_drop_item_pinned_ && cancel) if (drag_and_drop_item_pinned_ && cancel)
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "ash/launcher/launcher_button_host.h"
#include "ash/launcher/launcher_model_observer.h" #include "ash/launcher/launcher_model_observer.h"
#include "ash/shelf/shelf_button_host.h"
#include "ash/wm/gestures/shelf_gesture_handler.h" #include "ash/wm/gestures/shelf_gesture_handler.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "ui/app_list/views/app_list_drag_and_drop_host.h" #include "ui/app_list/views/app_list_drag_and_drop_host.h"
...@@ -50,7 +50,7 @@ class ShelfTooltipManager; ...@@ -50,7 +50,7 @@ class ShelfTooltipManager;
class ASH_EXPORT ShelfView : public views::View, class ASH_EXPORT ShelfView : public views::View,
public LauncherModelObserver, public LauncherModelObserver,
public views::ButtonListener, public views::ButtonListener,
public LauncherButtonHost, public ShelfButtonHost,
public views::ContextMenuController, public views::ContextMenuController,
public views::FocusTraversable, public views::FocusTraversable,
public views::BoundsAnimatorObserver, public views::BoundsAnimatorObserver,
...@@ -245,15 +245,13 @@ class ASH_EXPORT ShelfView : public views::View, ...@@ -245,15 +245,13 @@ class ASH_EXPORT ShelfView : public views::View,
virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE; virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE;
virtual void LauncherStatusChanged() OVERRIDE; virtual void LauncherStatusChanged() OVERRIDE;
// Overridden from LauncherButtonHost: // Overridden from ShelfButtonHost:
virtual void PointerPressedOnButton( virtual void PointerPressedOnButton(views::View* view,
views::View* view, Pointer pointer,
Pointer pointer, const ui::LocatedEvent& event) OVERRIDE;
const ui::LocatedEvent& event) OVERRIDE; virtual void PointerDraggedOnButton(views::View* view,
virtual void PointerDraggedOnButton( Pointer pointer,
views::View* view, const ui::LocatedEvent& event) OVERRIDE;
Pointer pointer,
const ui::LocatedEvent& event) OVERRIDE;
virtual void PointerReleasedOnButton(views::View* view, virtual void PointerReleasedOnButton(views::View* view,
Pointer pointer, Pointer pointer,
bool canceled) OVERRIDE; bool canceled) OVERRIDE;
......
...@@ -336,9 +336,9 @@ class ShelfViewTest : public AshTestBase { ...@@ -336,9 +336,9 @@ class ShelfViewTest : public AshTestBase {
} }
views::View* SimulateButtonPressed( views::View* SimulateButtonPressed(
internal::LauncherButtonHost::Pointer pointer, internal::ShelfButtonHost::Pointer pointer,
int button_index) { int button_index) {
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
views::View* button = test_api_->GetButton(button_index); views::View* button = test_api_->GetButton(button_index);
ui::MouseEvent click_event(ui::ET_MOUSE_PRESSED, ui::MouseEvent click_event(ui::ET_MOUSE_PRESSED,
button->bounds().origin(), button->bounds().origin(),
...@@ -347,20 +347,20 @@ class ShelfViewTest : public AshTestBase { ...@@ -347,20 +347,20 @@ class ShelfViewTest : public AshTestBase {
return button; return button;
} }
views::View* SimulateClick(internal::LauncherButtonHost::Pointer pointer, views::View* SimulateClick(internal::ShelfButtonHost::Pointer pointer,
int button_index) { int button_index) {
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
views::View* button = SimulateButtonPressed(pointer, button_index); views::View* button = SimulateButtonPressed(pointer, button_index);
button_host->PointerReleasedOnButton(button, button_host->PointerReleasedOnButton(button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
return button; return button;
} }
views::View* SimulateDrag(internal::LauncherButtonHost::Pointer pointer, views::View* SimulateDrag(internal::ShelfButtonHost::Pointer pointer,
int button_index, int button_index,
int destination_index) { int destination_index) {
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
views::View* button = SimulateButtonPressed(pointer, button_index); views::View* button = SimulateButtonPressed(pointer, button_index);
// Drag. // Drag.
...@@ -782,7 +782,7 @@ TEST_F(ShelfViewTest, AddButtonQuickly) { ...@@ -782,7 +782,7 @@ TEST_F(ShelfViewTest, AddButtonQuickly) {
// Check that model changes are handled correctly while a launcher icon is being // Check that model changes are handled correctly while a launcher icon is being
// dragged. // dragged.
TEST_F(ShelfViewTest, ModelChangesWhileDragging) { TEST_F(ShelfViewTest, ModelChangesWhileDragging) {
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
std::vector<std::pair<LauncherID, views::View*> > id_map; std::vector<std::pair<LauncherID, views::View*> > id_map;
SetupForDragTest(&id_map); SetupForDragTest(&id_map);
...@@ -790,19 +790,18 @@ TEST_F(ShelfViewTest, ModelChangesWhileDragging) { ...@@ -790,19 +790,18 @@ TEST_F(ShelfViewTest, ModelChangesWhileDragging) {
// Dragging browser shortcut at index 1. // Dragging browser shortcut at index 1.
EXPECT_TRUE(model_->items()[1].type == TYPE_BROWSER_SHORTCUT); EXPECT_TRUE(model_->items()[1].type == TYPE_BROWSER_SHORTCUT);
views::View* dragged_button = SimulateDrag( views::View* dragged_button = SimulateDrag(
internal::LauncherButtonHost::MOUSE, 1, 3); internal::ShelfButtonHost::MOUSE, 1, 3);
std::rotate(id_map.begin() + 1, std::rotate(id_map.begin() + 1,
id_map.begin() + 2, id_map.begin() + 2,
id_map.begin() + 4); id_map.begin() + 4);
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
EXPECT_TRUE(model_->items()[3].type == TYPE_BROWSER_SHORTCUT); EXPECT_TRUE(model_->items()[3].type == TYPE_BROWSER_SHORTCUT);
// Dragging changes model order. // Dragging changes model order.
dragged_button = SimulateDrag( dragged_button = SimulateDrag(internal::ShelfButtonHost::MOUSE, 1, 3);
internal::LauncherButtonHost::MOUSE, 1, 3);
std::rotate(id_map.begin() + 1, std::rotate(id_map.begin() + 1,
id_map.begin() + 2, id_map.begin() + 2,
id_map.begin() + 4); id_map.begin() + 4);
...@@ -810,7 +809,7 @@ TEST_F(ShelfViewTest, ModelChangesWhileDragging) { ...@@ -810,7 +809,7 @@ TEST_F(ShelfViewTest, ModelChangesWhileDragging) {
// Cancelling the drag operation restores previous order. // Cancelling the drag operation restores previous order.
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
true); true);
std::rotate(id_map.begin() + 1, std::rotate(id_map.begin() + 1,
id_map.begin() + 3, id_map.begin() + 3,
...@@ -818,38 +817,38 @@ TEST_F(ShelfViewTest, ModelChangesWhileDragging) { ...@@ -818,38 +817,38 @@ TEST_F(ShelfViewTest, ModelChangesWhileDragging) {
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
// Deleting an item keeps the remaining intact. // Deleting an item keeps the remaining intact.
dragged_button = SimulateDrag(internal::LauncherButtonHost::MOUSE, 1, 3); dragged_button = SimulateDrag(internal::ShelfButtonHost::MOUSE, 1, 3);
model_->RemoveItemAt(1); model_->RemoveItemAt(1);
id_map.erase(id_map.begin() + 1); id_map.erase(id_map.begin() + 1);
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
// Adding a launcher item cancels the drag and respects the order. // Adding a launcher item cancels the drag and respects the order.
dragged_button = SimulateDrag(internal::LauncherButtonHost::MOUSE, 1, 3); dragged_button = SimulateDrag(internal::ShelfButtonHost::MOUSE, 1, 3);
LauncherID new_id = AddAppShortcut(); LauncherID new_id = AddAppShortcut();
id_map.insert(id_map.begin() + 6, id_map.insert(id_map.begin() + 6,
std::make_pair(new_id, GetButtonByID(new_id))); std::make_pair(new_id, GetButtonByID(new_id)));
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
// Adding a launcher item at the end (i.e. a panel) canels drag and respects // Adding a launcher item at the end (i.e. a panel) canels drag and respects
// the order. // the order.
dragged_button = SimulateDrag(internal::LauncherButtonHost::MOUSE, 1, 3); dragged_button = SimulateDrag(internal::ShelfButtonHost::MOUSE, 1, 3);
new_id = AddPanel(); new_id = AddPanel();
id_map.insert(id_map.begin() + 7, id_map.insert(id_map.begin() + 7,
std::make_pair(new_id, GetButtonByID(new_id))); std::make_pair(new_id, GetButtonByID(new_id)));
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
} }
TEST_F(ShelfViewLegacyShelfLayoutTest, ModelChangesWhileDragging) { TEST_F(ShelfViewLegacyShelfLayoutTest, ModelChangesWhileDragging) {
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
std::vector<std::pair<LauncherID, views::View*> > id_map; std::vector<std::pair<LauncherID, views::View*> > id_map;
SetupForDragTest(&id_map); SetupForDragTest(&id_map);
...@@ -857,19 +856,18 @@ TEST_F(ShelfViewLegacyShelfLayoutTest, ModelChangesWhileDragging) { ...@@ -857,19 +856,18 @@ TEST_F(ShelfViewLegacyShelfLayoutTest, ModelChangesWhileDragging) {
// Dragging browser shortcut at index 0. // Dragging browser shortcut at index 0.
EXPECT_TRUE(model_->items()[0].type == TYPE_BROWSER_SHORTCUT); EXPECT_TRUE(model_->items()[0].type == TYPE_BROWSER_SHORTCUT);
views::View* dragged_button = SimulateDrag( views::View* dragged_button = SimulateDrag(
internal::LauncherButtonHost::MOUSE, 0, 2); internal::ShelfButtonHost::MOUSE, 0, 2);
std::rotate(id_map.begin(), std::rotate(id_map.begin(),
id_map.begin() + 1, id_map.begin() + 1,
id_map.begin() + 3); id_map.begin() + 3);
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
EXPECT_TRUE(model_->items()[2].type == TYPE_BROWSER_SHORTCUT); EXPECT_TRUE(model_->items()[2].type == TYPE_BROWSER_SHORTCUT);
// Dragging changes model order. // Dragging changes model order.
dragged_button = SimulateDrag( dragged_button = SimulateDrag(internal::ShelfButtonHost::MOUSE, 0, 2);
internal::LauncherButtonHost::MOUSE, 0, 2);
std::rotate(id_map.begin(), std::rotate(id_map.begin(),
id_map.begin() + 1, id_map.begin() + 1,
id_map.begin() + 3); id_map.begin() + 3);
...@@ -877,7 +875,7 @@ TEST_F(ShelfViewLegacyShelfLayoutTest, ModelChangesWhileDragging) { ...@@ -877,7 +875,7 @@ TEST_F(ShelfViewLegacyShelfLayoutTest, ModelChangesWhileDragging) {
// Cancelling the drag operation restores previous order. // Cancelling the drag operation restores previous order.
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
true); true);
std::rotate(id_map.begin(), std::rotate(id_map.begin(),
id_map.begin() + 2, id_map.begin() + 2,
...@@ -885,80 +883,78 @@ TEST_F(ShelfViewLegacyShelfLayoutTest, ModelChangesWhileDragging) { ...@@ -885,80 +883,78 @@ TEST_F(ShelfViewLegacyShelfLayoutTest, ModelChangesWhileDragging) {
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
// Deleting an item keeps the remaining intact. // Deleting an item keeps the remaining intact.
dragged_button = SimulateDrag(internal::LauncherButtonHost::MOUSE, 0, 2); dragged_button = SimulateDrag(internal::ShelfButtonHost::MOUSE, 0, 2);
model_->RemoveItemAt(1); model_->RemoveItemAt(1);
id_map.erase(id_map.begin() + 1); id_map.erase(id_map.begin() + 1);
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
// Adding a launcher item cancels the drag and respects the order. // Adding a launcher item cancels the drag and respects the order.
dragged_button = SimulateDrag(internal::LauncherButtonHost::MOUSE, 0, 2); dragged_button = SimulateDrag(internal::ShelfButtonHost::MOUSE, 0, 2);
LauncherID new_id = AddAppShortcut(); LauncherID new_id = AddAppShortcut();
id_map.insert(id_map.begin() + 5, id_map.insert(id_map.begin() + 5,
std::make_pair(new_id, GetButtonByID(new_id))); std::make_pair(new_id, GetButtonByID(new_id)));
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
// Adding a launcher item at the end (i.e. a panel) canels drag and respects // Adding a launcher item at the end (i.e. a panel) canels drag and respects
// the order. // the order.
dragged_button = SimulateDrag(internal::LauncherButtonHost::MOUSE, 0, 2); dragged_button = SimulateDrag(internal::ShelfButtonHost::MOUSE, 0, 2);
new_id = AddPanel(); new_id = AddPanel();
id_map.insert(id_map.begin() + 7, id_map.insert(id_map.begin() + 7,
std::make_pair(new_id, GetButtonByID(new_id))); std::make_pair(new_id, GetButtonByID(new_id)));
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
} }
// Check that 2nd drag from the other pointer would be ignored. // Check that 2nd drag from the other pointer would be ignored.
TEST_F(ShelfViewTest, SimultaneousDrag) { TEST_F(ShelfViewTest, SimultaneousDrag) {
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
std::vector<std::pair<LauncherID, views::View*> > id_map; std::vector<std::pair<LauncherID, views::View*> > id_map;
SetupForDragTest(&id_map); SetupForDragTest(&id_map);
// Start a mouse drag. // Start a mouse drag.
views::View* dragged_button_mouse = SimulateDrag( views::View* dragged_button_mouse = SimulateDrag(
internal::LauncherButtonHost::MOUSE, 1, 3); internal::ShelfButtonHost::MOUSE, 1, 3);
std::rotate(id_map.begin() + 1, std::rotate(id_map.begin() + 1,
id_map.begin() + 2, id_map.begin() + 2,
id_map.begin() + 4); id_map.begin() + 4);
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
// Attempt a touch drag before the mouse drag finishes. // Attempt a touch drag before the mouse drag finishes.
views::View* dragged_button_touch = SimulateDrag( views::View* dragged_button_touch = SimulateDrag(
internal::LauncherButtonHost::TOUCH, 4, 2); internal::ShelfButtonHost::TOUCH, 4, 2);
// Nothing changes since 2nd drag is ignored. // Nothing changes since 2nd drag is ignored.
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
// Finish the mouse drag. // Finish the mouse drag.
button_host->PointerReleasedOnButton(dragged_button_mouse, button_host->PointerReleasedOnButton(dragged_button_mouse,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
// Now start a touch drag. // Now start a touch drag.
dragged_button_touch = SimulateDrag( dragged_button_touch = SimulateDrag(internal::ShelfButtonHost::TOUCH, 4, 2);
internal::LauncherButtonHost::TOUCH, 4, 2);
std::rotate(id_map.begin() + 3, std::rotate(id_map.begin() + 3,
id_map.begin() + 4, id_map.begin() + 4,
id_map.begin() + 5); id_map.begin() + 5);
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
// And attempt a mouse drag before the touch drag finishes. // And attempt a mouse drag before the touch drag finishes.
dragged_button_mouse = SimulateDrag( dragged_button_mouse = SimulateDrag(internal::ShelfButtonHost::MOUSE, 1, 2);
internal::LauncherButtonHost::MOUSE, 1, 2);
// Nothing changes since 2nd drag is ignored. // Nothing changes since 2nd drag is ignored.
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button_touch, button_host->PointerReleasedOnButton(dragged_button_touch,
internal::LauncherButtonHost::TOUCH, internal::ShelfButtonHost::TOUCH,
false); false);
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
} }
...@@ -966,24 +962,24 @@ TEST_F(ShelfViewTest, SimultaneousDrag) { ...@@ -966,24 +962,24 @@ TEST_F(ShelfViewTest, SimultaneousDrag) {
// Check that clicking first on one item and then dragging another works as // Check that clicking first on one item and then dragging another works as
// expected. // expected.
TEST_F(ShelfViewTest, ClickOneDragAnother) { TEST_F(ShelfViewTest, ClickOneDragAnother) {
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
std::vector<std::pair<LauncherID, views::View*> > id_map; std::vector<std::pair<LauncherID, views::View*> > id_map;
SetupForDragTest(&id_map); SetupForDragTest(&id_map);
// A click on item 1 is simulated. // A click on item 1 is simulated.
SimulateClick(internal::LauncherButtonHost::MOUSE, 1); SimulateClick(internal::ShelfButtonHost::MOUSE, 1);
// Dragging browser index at 0 should change the model order correctly. // Dragging browser index at 0 should change the model order correctly.
EXPECT_TRUE(model_->items()[1].type == TYPE_BROWSER_SHORTCUT); EXPECT_TRUE(model_->items()[1].type == TYPE_BROWSER_SHORTCUT);
views::View* dragged_button = SimulateDrag( views::View* dragged_button = SimulateDrag(
internal::LauncherButtonHost::MOUSE, 1, 3); internal::ShelfButtonHost::MOUSE, 1, 3);
std::rotate(id_map.begin() + 1, std::rotate(id_map.begin() + 1,
id_map.begin() + 2, id_map.begin() + 2,
id_map.begin() + 4); id_map.begin() + 4);
ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map)); ASSERT_NO_FATAL_FAILURE(CheckModelIDs(id_map));
button_host->PointerReleasedOnButton(dragged_button, button_host->PointerReleasedOnButton(dragged_button,
internal::LauncherButtonHost::MOUSE, internal::ShelfButtonHost::MOUSE,
false); false);
EXPECT_TRUE(model_->items()[3].type == TYPE_BROWSER_SHORTCUT); EXPECT_TRUE(model_->items()[3].type == TYPE_BROWSER_SHORTCUT);
} }
...@@ -1084,7 +1080,7 @@ TEST_F(ShelfViewTest, ShelfTooltipTest) { ...@@ -1084,7 +1080,7 @@ TEST_F(ShelfViewTest, ShelfTooltipTest) {
internal::LauncherButton* app_button = GetButtonByID(app_button_id); internal::LauncherButton* app_button = GetButtonByID(app_button_id);
internal::LauncherButton* platform_button = GetButtonByID(platform_button_id); internal::LauncherButton* platform_button = GetButtonByID(platform_button_id);
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
internal::ShelfTooltipManager* tooltip_manager = internal::ShelfTooltipManager* tooltip_manager =
shelf_view_->tooltip_manager(); shelf_view_->tooltip_manager();
...@@ -1122,7 +1118,7 @@ TEST_F(ShelfViewTest, ShelfTooltipTest) { ...@@ -1122,7 +1118,7 @@ TEST_F(ShelfViewTest, ShelfTooltipTest) {
// Verify a fix for crash caused by a tooltip update for a deleted launcher // Verify a fix for crash caused by a tooltip update for a deleted launcher
// button, see crbug.com/288838. // button, see crbug.com/288838.
TEST_F(ShelfViewTest, RemovingItemClosesTooltip) { TEST_F(ShelfViewTest, RemovingItemClosesTooltip) {
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
internal::ShelfTooltipManager* tooltip_manager = internal::ShelfTooltipManager* tooltip_manager =
shelf_view_->tooltip_manager(); shelf_view_->tooltip_manager();
...@@ -1148,7 +1144,7 @@ TEST_F(ShelfViewTest, RemovingItemClosesTooltip) { ...@@ -1148,7 +1144,7 @@ TEST_F(ShelfViewTest, RemovingItemClosesTooltip) {
// Changing the shelf alignment closes any open tooltip. // Changing the shelf alignment closes any open tooltip.
TEST_F(ShelfViewTest, ShelfAlignmentClosesTooltip) { TEST_F(ShelfViewTest, ShelfAlignmentClosesTooltip) {
internal::LauncherButtonHost* button_host = shelf_view_; internal::ShelfButtonHost* button_host = shelf_view_;
internal::ShelfTooltipManager* tooltip_manager = internal::ShelfTooltipManager* tooltip_manager =
shelf_view_->tooltip_manager(); shelf_view_->tooltip_manager();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment