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

Side by Side Diff: ui/views/widget/tooltip_manager_aura.cc

Issue 916423002: Tooltip Cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win build fix Created 5 years, 10 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/views/widget/tooltip_manager_aura.h ('k') | ui/wm/public/tooltip_client.h » ('j') | 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/views/widget/tooltip_manager_aura.h" 5 #include "ui/views/widget/tooltip_manager_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/client/screen_position_client.h" 8 #include "ui/aura/client/screen_position_client.h"
9 #include "ui/aura/window_event_dispatcher.h" 9 #include "ui/aura/window_event_dispatcher.h"
10 #include "ui/aura/window_tree_host.h" 10 #include "ui/aura/window_tree_host.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 } 75 }
76 76
77 //////////////////////////////////////////////////////////////////////////////// 77 ////////////////////////////////////////////////////////////////////////////////
78 // TooltipManagerAura, TooltipManager implementation: 78 // TooltipManagerAura, TooltipManager implementation:
79 79
80 const gfx::FontList& TooltipManagerAura::GetFontList() const { 80 const gfx::FontList& TooltipManagerAura::GetFontList() const {
81 return GetDefaultFontList(); 81 return GetDefaultFontList();
82 } 82 }
83 83
84 int TooltipManagerAura::GetMaxWidth(const gfx::Point& point,
85 aura::Window* context) const {
86 return aura::client::GetTooltipClient(context->GetRootWindow())->
87 GetMaxWidth(point, context);
88 }
89
84 void TooltipManagerAura::UpdateTooltip() { 90 void TooltipManagerAura::UpdateTooltip() {
85 aura::Window* root_window = GetWindow()->GetRootWindow(); 91 aura::Window* root_window = GetWindow()->GetRootWindow();
86 if (aura::client::GetTooltipClient(root_window)) { 92 if (aura::client::GetTooltipClient(root_window)) {
87 gfx::Point view_point = 93 gfx::Point view_point =
88 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 94 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
89 aura::Window::ConvertPointToTarget(root_window, GetWindow(), &view_point); 95 aura::Window::ConvertPointToTarget(root_window, GetWindow(), &view_point);
90 View* view = GetViewUnderPoint(view_point); 96 View* view = GetViewUnderPoint(view_point);
91 UpdateTooltipForTarget(view, view_point, root_window); 97 UpdateTooltipForTarget(view, view_point, root_window);
92 } 98 }
93 } 99 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 aura::client::SetTooltipId(GetWindow(), target); 136 aura::client::SetTooltipId(GetWindow(), target);
131 137
132 aura::client::GetTooltipClient(root_window)->UpdateTooltip(GetWindow()); 138 aura::client::GetTooltipClient(root_window)->UpdateTooltip(GetWindow());
133 } 139 }
134 140
135 aura::Window* TooltipManagerAura::GetWindow() { 141 aura::Window* TooltipManagerAura::GetWindow() {
136 return widget_->GetNativeView(); 142 return widget_->GetNativeView();
137 } 143 }
138 144
139 } // namespace views. 145 } // namespace views.
OLDNEW
« no previous file with comments | « ui/views/widget/tooltip_manager_aura.h ('k') | ui/wm/public/tooltip_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698