diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-01 17:57:11 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-01 17:57:11 +0000 |
commit | d0e72eadd78c885a8148352076a33cc39709c698 (patch) | |
tree | e52a6a714acc072cd557ee1c0cb701526fcc19d5 /ash/tooltips | |
parent | fe160fb6f0c7999b9dbc81151f5fdfdb1d2ba241 (diff) | |
download | chromium_src-d0e72eadd78c885a8148352076a33cc39709c698.zip chromium_src-d0e72eadd78c885a8148352076a33cc39709c698.tar.gz chromium_src-d0e72eadd78c885a8148352076a33cc39709c698.tar.bz2 |
Remove more root window dependencies
BUG=123160
TEST=no functional change. all tests should pass.
Review URL: https://chromiumcodereview.appspot.com/10441146
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/tooltips')
-rw-r--r-- | ash/tooltips/tooltip_controller.cc | 14 | ||||
-rw-r--r-- | ash/tooltips/tooltip_controller.h | 11 |
2 files changed, 14 insertions, 11 deletions
diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc index 1036234..bb0f55e 100644 --- a/ash/tooltips/tooltip_controller.cc +++ b/ash/tooltips/tooltip_controller.cc @@ -177,8 +177,10 @@ class TooltipController::Tooltip { //////////////////////////////////////////////////////////////////////////////// // TooltipController public: -TooltipController::TooltipController() - : tooltip_window_(NULL), +TooltipController::TooltipController( + aura::client::DragDropClient* drag_drop_client) + : drag_drop_client_(drag_drop_client), + tooltip_window_(NULL), tooltip_window_at_mouse_press_(NULL), mouse_pressed_(false), tooltip_(new Tooltip), @@ -186,7 +188,7 @@ TooltipController::TooltipController() tooltip_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kTooltipTimeoutMs), this, &TooltipController::TooltipTimerFired); - aura::client::SetTooltipClient(Shell::GetPrimaryRootWindow(), this); + DCHECK(drag_drop_client_); } TooltipController::~TooltipController() { @@ -418,11 +420,7 @@ bool TooltipController::IsTooltipVisible() { } bool TooltipController::IsDragDropInProgress() { - aura::client::DragDropClient* client = aura::client::GetDragDropClient( - Shell::GetPrimaryRootWindow()); - if (client) - return client->IsDragDropInProgress(); - return false; + return drag_drop_client_->IsDragDropInProgress(); } } // namespace internal diff --git a/ash/tooltips/tooltip_controller.h b/ash/tooltips/tooltip_controller.h index 5e9d103..68f4a7b 100644 --- a/ash/tooltips/tooltip_controller.h +++ b/ash/tooltips/tooltip_controller.h @@ -20,6 +20,9 @@ class KeyEvent; class MouseEvent; class TouchEvent; class Window; +namespace client { +class DragDropClient; +} } namespace ash { @@ -32,10 +35,10 @@ namespace internal { // TooltipController provides tooltip functionality for aura shell. class ASH_EXPORT TooltipController : public aura::client::TooltipClient, - public aura::EventFilter, - public aura::WindowObserver { + public aura::EventFilter, + public aura::WindowObserver { public: - TooltipController(); + explicit TooltipController(aura::client::DragDropClient* drag_drop_client); virtual ~TooltipController(); // Overridden from aura::client::TooltipClient. @@ -81,6 +84,8 @@ class ASH_EXPORT TooltipController : public aura::client::TooltipClient, bool IsDragDropInProgress(); + aura::client::DragDropClient* drag_drop_client_; + aura::Window* tooltip_window_; string16 tooltip_text_; |