summaryrefslogtreecommitdiffstats
path: root/ui/wm/public
diff options
context:
space:
mode:
authormboc@opera.com <mboc@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 13:28:31 +0000
committermboc@opera.com <mboc@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 13:28:31 +0000
commit11253640f3fadf6c78ba316046b2419b7c123ea3 (patch)
treee4cf1c1dc88d2b214b07015a8f672ea281941426 /ui/wm/public
parentd8fc4720c06d9e57d5fd98d6d6b723fffddbe159 (diff)
downloadchromium_src-11253640f3fadf6c78ba316046b2419b7c123ea3.zip
chromium_src-11253640f3fadf6c78ba316046b2419b7c123ea3.tar.gz
chromium_src-11253640f3fadf6c78ba316046b2419b7c123ea3.tar.bz2
Aura tooltips do not move on mouse move in case of many neighboring
views with the same tooltip label BUG=Aura tooltips do not move on mouse move in case of many neighboring views with the same tooltip label. This can be really uncomfortable when working with lots of tabs with the same address on the tab strip. Try creating ~30 startpage tabs and hover over one of them, then move the cursor to others. The tooltip will just sit in the place where it was first shown. Review URL: https://codereview.chromium.org/213833018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/wm/public')
-rw-r--r--ui/wm/public/tooltip_client.cc10
-rw-r--r--ui/wm/public/tooltip_client.h8
2 files changed, 17 insertions, 1 deletions
diff --git a/ui/wm/public/tooltip_client.cc b/ui/wm/public/tooltip_client.cc
index b473238..844cca5 100644
--- a/ui/wm/public/tooltip_client.cc
+++ b/ui/wm/public/tooltip_client.cc
@@ -9,6 +9,7 @@
DECLARE_WINDOW_PROPERTY_TYPE(aura::client::TooltipClient*)
DECLARE_WINDOW_PROPERTY_TYPE(base::string16*)
+DECLARE_WINDOW_PROPERTY_TYPE(void**)
namespace aura {
namespace client {
@@ -16,6 +17,7 @@ namespace client {
DEFINE_LOCAL_WINDOW_PROPERTY_KEY(
TooltipClient*, kRootWindowTooltipClientKey, NULL);
DEFINE_LOCAL_WINDOW_PROPERTY_KEY(base::string16*, kTooltipTextKey, NULL);
+DEFINE_LOCAL_WINDOW_PROPERTY_KEY(void*, kTooltipIdKey, NULL);
void SetTooltipClient(Window* root_window, TooltipClient* client) {
DCHECK_EQ(root_window->GetRootWindow(), root_window);
@@ -33,10 +35,18 @@ void SetTooltipText(Window* window, base::string16* tooltip_text) {
window->SetProperty(kTooltipTextKey, tooltip_text);
}
+void SetTooltipId(Window* window, void* id) {
+ window->SetProperty(kTooltipIdKey, id);
+}
+
const base::string16 GetTooltipText(Window* window) {
base::string16* string_ptr = window->GetProperty(kTooltipTextKey);
return string_ptr ? *string_ptr : base::string16();
}
+const void* GetTooltipId(Window* window) {
+ return window->GetProperty(kTooltipIdKey);
+}
+
} // namespace client
} // namespace aura
diff --git a/ui/wm/public/tooltip_client.h b/ui/wm/public/tooltip_client.h
index f592b21..f2b97cd 100644
--- a/ui/wm/public/tooltip_client.h
+++ b/ui/wm/public/tooltip_client.h
@@ -36,8 +36,14 @@ AURA_EXPORT void SetTooltipClient(Window* root_window,
TooltipClient* client);
AURA_EXPORT TooltipClient* GetTooltipClient(Window* root_window);
-AURA_EXPORT void SetTooltipText(Window* window, base::string16* tooltip_text);
+// Sets the text for the tooltip. The id is used to determine uniqueness when
+// the text does not change. For example, if the tooltip text does not change,
+// but the id does then the position of the tooltip is updated.
+AURA_EXPORT void SetTooltipText(Window* window,
+ base::string16* tooltip_text);
+AURA_EXPORT void SetTooltipId(Window* window, void* id);
AURA_EXPORT const base::string16 GetTooltipText(Window* window);
+AURA_EXPORT const void* GetTooltipId(Window* window);
} // namespace client
} // namespace aura