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

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

Issue 213833018: Aura tooltips do not move on mouse move in case of many neighboring views with the same label (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sanity fixups Created 6 years, 8 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
Index: ui/views/corewm/tooltip_controller.cc
diff --git a/ui/views/corewm/tooltip_controller.cc b/ui/views/corewm/tooltip_controller.cc
index 500466fdf4d646c69ccba8f31c98ef85a8f9496c..37bb99b89fd3ecf04686c89304c0fd8a3a34661e 100644
--- a/ui/views/corewm/tooltip_controller.cc
+++ b/ui/views/corewm/tooltip_controller.cc
@@ -115,6 +115,7 @@ aura::Window* GetTooltipTarget(const ui::MouseEvent& event,
TooltipController::TooltipController(scoped_ptr<Tooltip> tooltip)
: tooltip_window_(NULL),
+ tooltip_unique_(NULL),
tooltip_window_at_mouse_press_(NULL),
tooltip_(tooltip.Pass()),
tooltips_enabled_(true) {
@@ -275,12 +276,23 @@ void TooltipController::UpdateIfRequired() {
tooltip_window_at_mouse_press_ = NULL;
}
+ // If the uniqueness indicator is different from the previously encountered
+ // one, we should force tooltip update
+ const void* tooltip_unique = aura::client::GetTooltipUnique(tooltip_window_);
+ bool force = false;
sky 2014/04/23 20:08:46 force->ids_differ
Mikus 2014/04/24 08:39:56 Done.
+ if (tooltip_unique) {
+ force = tooltip_unique_ != tooltip_unique;
+ tooltip_unique_ = tooltip_unique;
+ } else {
+ tooltip_unique_ = NULL;
+ }
+
// We add the !tooltip_->IsVisible() below because when we come here from
// TooltipTimerFired(), the tooltip_text may not have changed but we still
// want to update the tooltip because the timer has fired.
// If we come here from UpdateTooltip(), we have already checked for tooltip
// visibility and this check below will have no effect.
- if (tooltip_text_ != tooltip_text || !tooltip_->IsVisible()) {
+ if (tooltip_text_ != tooltip_text || !tooltip_->IsVisible() || force) {
tooltip_shown_timer_.Stop();
tooltip_text_ = tooltip_text;
base::string16 trimmed_text(tooltip_text_);

Powered by Google App Engine
This is Rietveld 408576698