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

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

Issue 1020603002: [Win] Don't crash when updating tooltip and the ClientView hasn't been added to the view hierarchy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | 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/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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 int TooltipManagerAura::GetMaxWidth(const gfx::Point& point, 84 int TooltipManagerAura::GetMaxWidth(const gfx::Point& point,
85 aura::Window* context) const { 85 aura::Window* context) const {
86 return aura::client::GetTooltipClient(context->GetRootWindow())-> 86 return aura::client::GetTooltipClient(context->GetRootWindow())->
87 GetMaxWidth(point, context); 87 GetMaxWidth(point, context);
88 } 88 }
89 89
90 void TooltipManagerAura::UpdateTooltip() { 90 void TooltipManagerAura::UpdateTooltip() {
91 aura::Window* root_window = GetWindow()->GetRootWindow(); 91 aura::Window* root_window = GetWindow()->GetRootWindow();
92 if (aura::client::GetTooltipClient(root_window)) { 92 if (aura::client::GetTooltipClient(root_window)) {
93 if (!widget_->IsVisible()) {
94 UpdateTooltipForTarget(NULL, gfx::Point(), root_window);
95 return;
96 }
93 gfx::Point view_point = 97 gfx::Point view_point =
94 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 98 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
95 aura::Window::ConvertPointToTarget(root_window, GetWindow(), &view_point); 99 aura::Window::ConvertPointToTarget(root_window, GetWindow(), &view_point);
96 View* view = GetViewUnderPoint(view_point); 100 View* view = GetViewUnderPoint(view_point);
97 UpdateTooltipForTarget(view, view_point, root_window); 101 UpdateTooltipForTarget(view, view_point, root_window);
98 } 102 }
99 } 103 }
100 104
101 void TooltipManagerAura::TooltipTextChanged(View* view) { 105 void TooltipManagerAura::TooltipTextChanged(View* view) {
102 aura::Window* root_window = GetWindow()->GetRootWindow(); 106 aura::Window* root_window = GetWindow()->GetRootWindow();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 aura::client::SetTooltipId(GetWindow(), target); 140 aura::client::SetTooltipId(GetWindow(), target);
137 141
138 aura::client::GetTooltipClient(root_window)->UpdateTooltip(GetWindow()); 142 aura::client::GetTooltipClient(root_window)->UpdateTooltip(GetWindow());
139 } 143 }
140 144
141 aura::Window* TooltipManagerAura::GetWindow() { 145 aura::Window* TooltipManagerAura::GetWindow() {
142 return widget_->GetNativeView(); 146 return widget_->GetNativeView();
143 } 147 }
144 148
145 } // namespace views. 149 } // namespace views.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698