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

Side by Side Diff: ui/wm/public/tooltip_client.cc

Issue 2615993002: Remove unnecessary spin in ToolTipController (Closed)
Patch Set: Address comments. Created 3 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 unified diff | Download patch
« no previous file with comments | « ui/wm/public/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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/wm/public/tooltip_client.h" 5 #include "ui/wm/public/tooltip_client.h"
6 6
7 #include "ui/aura/window.h"
8 #include "ui/aura/window_property.h" 7 #include "ui/aura/window_property.h"
9 8
10 DECLARE_WINDOW_PROPERTY_TYPE(aura::client::TooltipClient*) 9 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(AURA_EXPORT, aura::client::TooltipClient*)
11 DECLARE_WINDOW_PROPERTY_TYPE(void**) 10 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(AURA_EXPORT, void**)
12 11
13 namespace aura { 12 namespace aura {
14 namespace client { 13 namespace client {
15 14
16 DEFINE_LOCAL_WINDOW_PROPERTY_KEY( 15 DEFINE_WINDOW_PROPERTY_KEY(TooltipClient*, kRootWindowTooltipClientKey, NULL);
17 TooltipClient*, kRootWindowTooltipClientKey, NULL); 16 DEFINE_WINDOW_PROPERTY_KEY(base::string16*, kTooltipTextKey, NULL);
18 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(base::string16*, kTooltipTextKey, NULL); 17 DEFINE_WINDOW_PROPERTY_KEY(void*, kTooltipIdKey, NULL);
19 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(void*, kTooltipIdKey, NULL);
20 18
21 void SetTooltipClient(Window* root_window, TooltipClient* client) { 19 void SetTooltipClient(Window* root_window, TooltipClient* client) {
22 DCHECK_EQ(root_window->GetRootWindow(), root_window); 20 DCHECK_EQ(root_window->GetRootWindow(), root_window);
23 root_window->SetProperty(kRootWindowTooltipClientKey, client); 21 root_window->SetProperty(kRootWindowTooltipClientKey, client);
24 } 22 }
25 23
26 TooltipClient* GetTooltipClient(Window* root_window) { 24 TooltipClient* GetTooltipClient(Window* root_window) {
27 if (root_window) 25 if (root_window)
28 DCHECK_EQ(root_window->GetRootWindow(), root_window); 26 DCHECK_EQ(root_window->GetRootWindow(), root_window);
29 return root_window ? 27 return root_window ?
(...skipping 12 matching lines...) Expand all
42 base::string16* string_ptr = window->GetProperty(kTooltipTextKey); 40 base::string16* string_ptr = window->GetProperty(kTooltipTextKey);
43 return string_ptr ? *string_ptr : base::string16(); 41 return string_ptr ? *string_ptr : base::string16();
44 } 42 }
45 43
46 const void* GetTooltipId(Window* window) { 44 const void* GetTooltipId(Window* window) {
47 return window->GetProperty(kTooltipIdKey); 45 return window->GetProperty(kTooltipIdKey);
48 } 46 }
49 47
50 } // namespace client 48 } // namespace client
51 } // namespace aura 49 } // namespace aura
OLDNEW
« no previous file with comments | « ui/wm/public/tooltip_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698