Index: ui/views/widget/desktop_aura/scoped_tooltip_client.h |
diff --git a/ui/views/widget/desktop_aura/scoped_tooltip_client.h b/ui/views/widget/desktop_aura/scoped_tooltip_client.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b707bbc82033461469df37682739ed9a39bdab40 |
--- /dev/null |
+++ b/ui/views/widget/desktop_aura/scoped_tooltip_client.h |
@@ -0,0 +1,43 @@ |
+// Copyright (c) 2013 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. |
+ |
+#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_SCOPED_TOOLTIP_CLIENT_H_ |
+#define UI_VIEWS_WIDGET_DESKTOP_AURA_SCOPED_TOOLTIP_CLIENT_H_ |
+ |
+#include "base/basictypes.h" |
+ |
+namespace aura { |
+class RootWindow; |
+} |
+ |
+namespace views { |
+ |
+namespace corewm { |
+class TooltipController; |
+} |
+ |
+// ScopedTooltipClient is responsible for installing a TooltipClient |
+// implementation on a RootWindow. Additionally it ensures only one |
+// TooltipController is only ever created. In this way all |
+// DesktopNativeWidgetAuras share the same TooltipClient. |
+class ScopedTooltipClient { |
+ public: |
+ explicit ScopedTooltipClient(aura::RootWindow* root_window); |
+ ~ScopedTooltipClient(); |
+ |
+ private: |
+ // Single TooltipController. |
+ static corewm::TooltipController* tooltip_controller_; |
+ |
+ // Number of ScopedTooltipClients created. |
+ static int scoped_tooltip_client_count_; |
+ |
+ aura::RootWindow* root_window_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ScopedTooltipClient); |
+}; |
+ |
+} // namespace views |
+ |
+#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_SCOPED_TOOLTIP_CLIENT_H_ |