Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / wm / public / scoped_tooltip_disabler.h
blob0fd3e113eee6fded6c9d308a7a0fb88d42f5b7e3
1 // Copyright 2014 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.
5 #ifndef UI_WM_PUBLIC_SCOPED_TOOLTIP_DISABLER_H_
6 #define UI_WM_PUBLIC_SCOPED_TOOLTIP_DISABLER_H_
8 #include "ui/aura/window_observer.h"
10 namespace aura {
11 namespace client {
13 // Use to temporarily disable tooltips.
14 class AURA_EXPORT ScopedTooltipDisabler : aura::WindowObserver {
15 public:
16 // Disables tooltips on |window| (does nothing if |window| is NULL). Tooltips
17 // are reenabled from the destructor when there are no most outstanding
18 // ScopedTooltipDisablers for |window|.
19 explicit ScopedTooltipDisabler(aura::Window* window);
20 virtual ~ScopedTooltipDisabler();
22 private:
23 // Reenables the tooltips on the TooltipClient.
24 void EnableTooltips();
26 // aura::WindowObserver:
27 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
29 // The RootWindow to disable Tooltips on; NULL if the Window passed to the
30 // constructor was not in a root or the root has been destroyed.
31 aura::Window* root_;
33 DISALLOW_COPY_AND_ASSIGN(ScopedTooltipDisabler);
36 } // namespace client
37 } // namespace aura
39 #endif // UI_WM_PUBLIC_SCOPED_TOOLTIP_DISABLER_H_