diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-21 01:17:36 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-21 01:17:36 +0000 |
commit | af5e2527f117e4187012285b731b7c19690b09c0 (patch) | |
tree | 6a81621eb664eeec75b8565e206a592c33625003 /ash/tooltips | |
parent | 5436bd2533a236ca3c6ff6cc7ce7b9a89e9ab10d (diff) | |
download | chromium_src-af5e2527f117e4187012285b731b7c19690b09c0.zip chromium_src-af5e2527f117e4187012285b731b7c19690b09c0.tar.gz chromium_src-af5e2527f117e4187012285b731b7c19690b09c0.tar.bz2 |
Plumbs through ET_CANCEL_MODE, which is intended to be used when modal
type operations should cancel, such as menus. This is a precursor to
moving TooltipController to views.
BUG=175441
R=sadrul@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12294051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/tooltips')
-rw-r--r-- | ash/tooltips/tooltip_controller.cc | 16 | ||||
-rw-r--r-- | ash/tooltips/tooltip_controller.h | 9 |
2 files changed, 5 insertions, 20 deletions
diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc index 8c187b6..c8bde19 100644 --- a/ash/tooltips/tooltip_controller.cc +++ b/ash/tooltips/tooltip_controller.cc @@ -10,8 +10,6 @@ #include "ash/shell.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/cursor_manager.h" -#include "ash/wm/session_state_controller.h" -#include "ash/wm/session_state_observer.h" #include "base/command_line.h" #include "base/location.h" #include "base/string_split.h" @@ -214,15 +212,11 @@ TooltipController::TooltipController( base::TimeDelta::FromMilliseconds(kTooltipTimeoutMs), this, &TooltipController::TooltipTimerFired); DCHECK(drag_drop_client_); - if (Shell::GetInstance()) - Shell::GetInstance()->session_state_controller()->AddObserver(this); } TooltipController::~TooltipController() { if (tooltip_window_) tooltip_window_->RemoveObserver(this); - if (Shell::GetInstance()) - Shell::GetInstance()->session_state_controller()->RemoveObserver(this); } void TooltipController::UpdateTooltip(aura::Window* target) { @@ -311,13 +305,9 @@ void TooltipController::OnTouchEvent(ui::TouchEvent* event) { tooltip_window_ = NULL; } -void TooltipController::OnSessionStateEvent( - SessionStateObserver::EventType event) { - if (event == SessionStateObserver::EVENT_PRELOCK_ANIMATION_STARTED || - event == SessionStateObserver::EVENT_LOCK_ANIMATION_STARTED) { - if (tooltip_.get() && tooltip_->IsVisible()) - tooltip_->Hide(); - } +void TooltipController::OnCancelMode(ui::CancelModeEvent* event) { + if (tooltip_.get() && tooltip_->IsVisible()) + tooltip_->Hide(); } void TooltipController::OnWindowDestroyed(aura::Window* window) { diff --git a/ash/tooltips/tooltip_controller.h b/ash/tooltips/tooltip_controller.h index 5f2215a..3022aee 100644 --- a/ash/tooltips/tooltip_controller.h +++ b/ash/tooltips/tooltip_controller.h @@ -6,7 +6,6 @@ #define ASH_TOOLTIPS_TOOLTIP_CONTROLLER_H_ #include "ash/ash_export.h" -#include "ash/wm/session_state_observer.h" #include "base/memory/scoped_ptr.h" #include "base/string16.h" #include "base/timer.h" @@ -33,8 +32,7 @@ namespace internal { // TooltipController provides tooltip functionality for aura shell. class ASH_EXPORT TooltipController : public aura::client::TooltipClient, public ui::EventHandler, - public aura::WindowObserver, - public SessionStateObserver { + public aura::WindowObserver { public: explicit TooltipController(aura::client::DragDropClient* drag_drop_client); virtual ~TooltipController(); @@ -47,10 +45,7 @@ class ASH_EXPORT TooltipController : public aura::client::TooltipClient, virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; - - // Overridden from SessionStateController. - virtual void OnSessionStateEvent(SessionStateObserver::EventType event) - OVERRIDE; + virtual void OnCancelMode(ui::CancelModeEvent* event) OVERRIDE; // Overridden from aura::WindowObserver. virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; |