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

Side by Side Diff: ui/views/widget/desktop_aura/scoped_tooltip_client.cc

Issue 23477022: Two changes to desktop aura for tooltips: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2013 Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/desktop_aura/scoped_tooltip_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include "ui/views/widget/desktop_aura/scoped_tooltip_client.h"
6
7 #include "ui/aura/root_window.h"
8 #include "ui/views/corewm/tooltip_controller.h"
9
10 namespace views {
11
12 // static
13 corewm::TooltipController* ScopedTooltipClient::tooltip_controller_ = NULL;
14
15 // static
16 int ScopedTooltipClient::scoped_tooltip_client_count_ = 0;
17
18 ScopedTooltipClient::ScopedTooltipClient(aura::RootWindow* root_window)
19 : root_window_(root_window) {
20 if (scoped_tooltip_client_count_++ == 0) {
21 tooltip_controller_ =
22 new corewm::TooltipController(gfx::SCREEN_TYPE_NATIVE);
23 }
24 aura::client::SetTooltipClient(root_window_, tooltip_controller_);
25 root_window_->AddPreTargetHandler(tooltip_controller_);
26 }
27
28 ScopedTooltipClient::~ScopedTooltipClient() {
29 root_window_->RemovePreTargetHandler(tooltip_controller_);
30 aura::client::SetTooltipClient(root_window_, NULL);
31 if (--scoped_tooltip_client_count_ == 0) {
32 delete tooltip_controller_;
33 tooltip_controller_ = NULL;
34 }
35 }
36
37 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/scoped_tooltip_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698