OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_SCOPED_TOOLTIP_CLIENT_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_SCOPED_TOOLTIP_CLIENT_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 |
| 10 namespace aura { |
| 11 class RootWindow; |
| 12 } |
| 13 |
| 14 namespace views { |
| 15 |
| 16 namespace corewm { |
| 17 class TooltipController; |
| 18 } |
| 19 |
| 20 // ScopedTooltipClient is responsible for installing a TooltipClient |
| 21 // implementation on a RootWindow. Additionally it ensures only one |
| 22 // TooltipController is only ever created. In this way all |
| 23 // DesktopNativeWidgetAuras share the same TooltipClient. |
| 24 class ScopedTooltipClient { |
| 25 public: |
| 26 explicit ScopedTooltipClient(aura::RootWindow* root_window); |
| 27 ~ScopedTooltipClient(); |
| 28 |
| 29 private: |
| 30 // Single TooltipController. |
| 31 static corewm::TooltipController* tooltip_controller_; |
| 32 |
| 33 // Number of ScopedTooltipClients created. |
| 34 static int scoped_tooltip_client_count_; |
| 35 |
| 36 aura::RootWindow* root_window_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(ScopedTooltipClient); |
| 39 }; |
| 40 |
| 41 } // namespace views |
| 42 |
| 43 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_SCOPED_TOOLTIP_CLIENT_H_ |
OLD | NEW |