Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1191)

Unified Diff: ui/views/corewm/tooltip_controller.h

Issue 2615993002: Remove unnecessary spin in ToolTipController (Closed)
Patch Set: Address comments. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/tooltips/tooltip_controller_unittest.cc ('k') | ui/views/corewm/tooltip_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/tooltip_controller.h
diff --git a/ui/views/corewm/tooltip_controller.h b/ui/views/corewm/tooltip_controller.h
index 5a274e319cd5edea134ef540a759884c323edbe0..7400132b35a7fcf9837a3ac96df109b0624fd09c 100644
--- a/ui/views/corewm/tooltip_controller.h
+++ b/ui/views/corewm/tooltip_controller.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/strings/string16.h"
#include "base/timer/timer.h"
+#include "ui/aura/client/cursor_client_observer.h"
#include "ui/aura/window_observer.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/geometry/point.h"
@@ -31,9 +32,11 @@ class TooltipControllerTestHelper;
} // namespace test
// TooltipController provides tooltip functionality for aura.
-class VIEWS_EXPORT TooltipController : public aura::client::TooltipClient,
- public ui::EventHandler,
- public aura::WindowObserver {
+class VIEWS_EXPORT TooltipController
+ : public aura::client::TooltipClient,
+ public ui::EventHandler,
+ public aura::client::CursorClientObserver,
+ public aura::WindowObserver {
public:
explicit TooltipController(std::unique_ptr<Tooltip> tooltip);
~TooltipController() override;
@@ -50,15 +53,20 @@ class VIEWS_EXPORT TooltipController : public aura::client::TooltipClient,
void OnTouchEvent(ui::TouchEvent* event) override;
void OnCancelMode(ui::CancelModeEvent* event) override;
+ // Overridden from aura::client::CursorClientObserver.
+ void OnCursorVisibilityChanged(bool is_visible) override;
+
// Overridden from aura::WindowObserver.
void OnWindowDestroyed(aura::Window* window) override;
+ void OnWindowPropertyChanged(aura::Window* window,
+ const void* key,
+ intptr_t old) override;
const gfx::Point& mouse_location() const { return curr_mouse_loc_; }
private:
friend class test::TooltipControllerTestHelper;
- void TooltipTimerFired();
void TooltipShownTimerFired();
// Updates the tooltip if required (if there is any change in the tooltip
@@ -90,8 +98,6 @@ class VIEWS_EXPORT TooltipController : public aura::client::TooltipClient,
std::unique_ptr<Tooltip> tooltip_;
- base::RepeatingTimer tooltip_timer_;
-
// Timer to timeout the life of an on-screen tooltip. We hide the tooltip when
// this timer fires.
base::OneShotTimer tooltip_shown_timer_;
« no previous file with comments | « ash/tooltips/tooltip_controller_unittest.cc ('k') | ui/views/corewm/tooltip_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698