| Index: mash/shelf/shelf_tooltip_manager.h
|
| diff --git a/ash/shelf/shelf_tooltip_manager.h b/mash/shelf/shelf_tooltip_manager.h
|
| similarity index 58%
|
| copy from ash/shelf/shelf_tooltip_manager.h
|
| copy to mash/shelf/shelf_tooltip_manager.h
|
| index 17eaee4b9e7f515591c94ddb5cb8e423914ccd13..48d598602d1f2b7710558c3389d8508f3cb6efc1 100644
|
| --- a/ash/shelf/shelf_tooltip_manager.h
|
| +++ b/mash/shelf/shelf_tooltip_manager.h
|
| @@ -2,19 +2,15 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef ASH_SHELF_SHELF_TOOLTIP_MANAGER_H_
|
| -#define ASH_SHELF_SHELF_TOOLTIP_MANAGER_H_
|
| +#ifndef MASH_SHELF_SHELF_TOOLTIP_MANAGER_H_
|
| +#define MASH_SHELF_SHELF_TOOLTIP_MANAGER_H_
|
|
|
| -#include "ash/ash_export.h"
|
| -#include "ash/shelf/shelf_layout_manager_observer.h"
|
| -#include "ash/shelf/shelf_types.h"
|
| #include "base/macros.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/strings/string16.h"
|
| +#include "mash/shelf/shelf_types.h"
|
| #include "ui/events/event_handler.h"
|
| -#include "ui/gfx/geometry/rect.h"
|
| -#include "ui/views/bubble/bubble_border.h"
|
| -#include "ui/views/bubble/bubble_delegate.h"
|
|
|
| namespace base {
|
| class Timer;
|
| @@ -22,12 +18,14 @@ class Timer;
|
|
|
| namespace views {
|
| class BubbleDelegateView;
|
| -class Label;
|
| +class View;
|
| +class Widget;
|
| }
|
|
|
| -namespace ash {
|
| +namespace mash {
|
| +namespace shelf {
|
| +
|
| class ShelfView;
|
| -class ShelfLayoutManager;
|
|
|
| namespace test {
|
| class ShelfTooltipManagerTest;
|
| @@ -35,15 +33,11 @@ class ShelfViewTest;
|
| }
|
|
|
| // ShelfTooltipManager manages the tooltip balloon poping up on shelf items.
|
| -class ASH_EXPORT ShelfTooltipManager : public ui::EventHandler,
|
| - public ShelfLayoutManagerObserver {
|
| +class ShelfTooltipManager : public ui::EventHandler {
|
| public:
|
| - ShelfTooltipManager(ShelfLayoutManager* shelf_layout_manager,
|
| - ShelfView* shelf_view);
|
| + explicit ShelfTooltipManager(ShelfView* shelf_view);
|
| ~ShelfTooltipManager() override;
|
|
|
| - ShelfLayoutManager* shelf_layout_manager() { return shelf_layout_manager_; }
|
| -
|
| // Called when the bubble is closed.
|
| void OnBubbleClosed(views::BubbleDelegateView* view);
|
|
|
| @@ -56,10 +50,6 @@ class ASH_EXPORT ShelfTooltipManager : public ui::EventHandler,
|
| // Closes the tooltip.
|
| void Close();
|
|
|
| - // Changes the arrow location of the tooltip in case that the launcher
|
| - // arrangement has changed.
|
| - void UpdateArrow();
|
| -
|
| // Resets the timer for the delayed showing |view_|. If the timer isn't
|
| // running, it starts a new timer.
|
| void ResetTimer();
|
| @@ -68,25 +58,27 @@ class ASH_EXPORT ShelfTooltipManager : public ui::EventHandler,
|
| void StopTimer();
|
|
|
| // Returns true if the tooltip is currently visible.
|
| - bool IsVisible();
|
| + bool IsVisible() const;
|
|
|
| // Returns the view to which the tooltip bubble is anchored. May be NULL.
|
| - views::View* GetCurrentAnchorView() { return anchor_; }
|
| + views::View* GetCurrentAnchorView() const;
|
|
|
| // Create an instant timer for test purposes.
|
| void CreateZeroDelayTimerForTest();
|
|
|
| + ShelfView* shelf_view() const { return shelf_view_; }
|
| +
|
| protected:
|
| // ui::EventHandler overrides:
|
| - void OnMouseEvent(ui::MouseEvent* event) override;
|
| - void OnTouchEvent(ui::TouchEvent* event) override;
|
| - void OnGestureEvent(ui::GestureEvent* event) override;
|
| - void OnCancelMode(ui::CancelModeEvent* event) override;
|
| + void OnMouseEvent(ui::MouseEvent* event) override;
|
| + void OnTouchEvent(ui::TouchEvent* event) override;
|
| + void OnGestureEvent(ui::GestureEvent* event) override;
|
| + void OnCancelMode(ui::CancelModeEvent* event) override;
|
|
|
| + /* TODO(msw): Restore functionality:
|
| // ShelfLayoutManagerObserver overrides:
|
| - void WillDeleteShelf() override;
|
| - void WillChangeVisibilityState(ShelfVisibilityState new_state) override;
|
| - void OnAutoHideStateChanged(ShelfAutoHideState new_state) override;
|
| + void WillChangeVisibilityState(ShelfVisibilityState new_state) override;
|
| + void OnAutoHideStateChanged(ShelfAutoHideState new_state) override;*/
|
|
|
| private:
|
| class ShelfTooltipBubble;
|
| @@ -101,11 +93,7 @@ protected:
|
|
|
| ShelfTooltipBubble* view_;
|
| views::Widget* widget_;
|
| - views::View* anchor_;
|
| - base::string16 text_;
|
| scoped_ptr<base::Timer> timer_;
|
| -
|
| - ShelfLayoutManager* shelf_layout_manager_;
|
| ShelfView* shelf_view_;
|
|
|
| base::WeakPtrFactory<ShelfTooltipManager> weak_factory_;
|
| @@ -113,6 +101,7 @@ protected:
|
| DISALLOW_COPY_AND_ASSIGN(ShelfTooltipManager);
|
| };
|
|
|
| -} // namespace ash
|
| +} // namespace shelf
|
| +} // namespace mash
|
|
|
| -#endif // ASH_SHELF_SHELF_TOOLTIP_MANAGER_H_
|
| +#endif // MASH_SHELF_SHELF_TOOLTIP_MANAGER_H_
|
|
|