diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 22:07:33 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 22:07:33 +0000 |
commit | 862deef098a8f161cb9926363bd4786f83fdbdc9 (patch) | |
tree | b4d0169e8d30fd064a3316f2e4e3bf3dd1e8d05e /ui/aura/client | |
parent | 2f22bbc93302fb84904e029bec7bab83f92b071a (diff) | |
download | chromium_src-862deef098a8f161cb9926363bd4786f83fdbdc9.zip chromium_src-862deef098a8f161cb9926363bd4786f83fdbdc9.tar.gz chromium_src-862deef098a8f161cb9926363bd4786f83fdbdc9.tar.bz2 |
Move TooltipClient to client namespace and add convenience setters/getters for it and the tooltip text.
BUG=none
TEST=existing automation
TBR=sky
Review URL: http://codereview.chromium.org/8974001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/client')
-rw-r--r-- | ui/aura/client/aura_constants.h | 2 | ||||
-rw-r--r-- | ui/aura/client/tooltip_client.cc | 31 | ||||
-rw-r--r-- | ui/aura/client/tooltip_client.h | 8 |
3 files changed, 39 insertions, 2 deletions
diff --git a/ui/aura/client/aura_constants.h b/ui/aura/client/aura_constants.h index a964c13..bd42ed6 100644 --- a/ui/aura/client/aura_constants.h +++ b/ui/aura/client/aura_constants.h @@ -47,7 +47,7 @@ AURA_EXPORT extern const char kRootWindowDragDropClientKey[]; AURA_EXPORT extern const char kRootWindowStackingClient[]; // A property key to store the tooltip client for the root window. The type of -// the value is |aura::TooltipClient*|. +// the value is |aura::client::TooltipClient*|. AURA_EXPORT extern const char kRootWindowTooltipClientKey[]; // A property key for a value from aura::ShadowType describing the drop shadow diff --git a/ui/aura/client/tooltip_client.cc b/ui/aura/client/tooltip_client.cc new file mode 100644 index 0000000..273eff16 --- /dev/null +++ b/ui/aura/client/tooltip_client.cc @@ -0,0 +1,31 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ui/aura/client/tooltip_client.h" + +#include "ui/aura/client/aura_constants.h" +#include "ui/aura/root_window.h" + +namespace aura { +namespace client { + +void SetTooltipClient(TooltipClient* client) { + RootWindow::GetInstance()->SetProperty(kRootWindowTooltipClientKey, client); +} + +TooltipClient* GetTooltipClient() { + return reinterpret_cast<TooltipClient*>( + RootWindow::GetInstance()->GetProperty(kRootWindowTooltipClientKey)); +} + +void SetTooltipText(Window* window, string16* tooltip_text) { + window->SetProperty(kTooltipTextKey, tooltip_text); +} + +string16* GetTooltipText(Window* window) { + return reinterpret_cast<string16*>(window->GetProperty(kTooltipTextKey)); +} + +} // namespace client +} // namespace aura diff --git a/ui/aura/client/tooltip_client.h b/ui/aura/client/tooltip_client.h index 1a137c9..ca1afb3 100644 --- a/ui/aura/client/tooltip_client.h +++ b/ui/aura/client/tooltip_client.h @@ -11,8 +11,8 @@ #include "ui/gfx/font.h" namespace aura { - class Window; +namespace client { class AURA_EXPORT TooltipClient { public: @@ -20,6 +20,12 @@ class AURA_EXPORT TooltipClient { virtual void UpdateTooltip(Window* target) = 0; }; +AURA_EXPORT void SetTooltipClient(TooltipClient* client); +AURA_EXPORT TooltipClient* GetTooltipClient(); +AURA_EXPORT void SetTooltipText(Window* window, string16* tooltip_text); +AURA_EXPORT string16* GetTooltipText(Window* window); + +} // namespace client } // namespace aura #endif // UI_AURA_CLIENT_TOOLTIP_CLIENT_H_ |