Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Unified Diff: ui/aura/client/scoped_tooltip_disabler.h

Issue 109403008: Disables showing tooltips while a system menu is showing on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move resetting Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/aura/client/scoped_tooltip_disabler.h
diff --git a/ui/aura/client/scoped_tooltip_disabler.h b/ui/aura/client/scoped_tooltip_disabler.h
new file mode 100644
index 0000000000000000000000000000000000000000..9514de312175b6a4b2062838ef0a6afd81085b90
--- /dev/null
+++ b/ui/aura/client/scoped_tooltip_disabler.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2014 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_AURA_CLIENT_SCOPED_TOOLTIP_DISABLER_H_
+#define UI_AURA_CLIENT_SCOPED_TOOLTIP_DISABLER_H_
+
+#include "ui/aura/window_observer.h"
+
+namespace aura {
+namespace client {
+
+// Use to temporarily disable tooltips.
+class AURA_EXPORT ScopedTooltipDisabler : aura::WindowObserver {
+ public:
+ // Disables tooltips on |window| (does nothing if |window| is NULL). Tooltips
+ // are reenabled from the destructor when there are no most outstanding
+ // ScopedTooltipDisablers for |window|.
+ explicit ScopedTooltipDisabler(aura::Window* window);
+ virtual ~ScopedTooltipDisabler();
+
+ private:
+ // Reenables the tooltips on the TooltipClient.
+ void EnableTooltips();
+
+ // aura::WindowObserver:
+ virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
+
+ // The RootWindow to disable Tooltips on; NULL if the Window passed to the
+ // constructor was not in a root or the root has been destroyed.
+ aura::Window* root_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedTooltipDisabler);
+};
+
+} // namespace client
+} // namespace aura
+
+#endif // UI_AURA_CLIENT_SCOPED_TOOLTIP_DISABLER_H_

Powered by Google App Engine
This is Rietveld 408576698