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

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

Issue 184903003: Window ownership -> WindowTreeHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 | Annotate | Revision Log
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/client/tooltip_client.h" 9 #include "ui/aura/client/tooltip_client.h"
10 #include "ui/aura/window_event_dispatcher.h" 10 #include "ui/aura/window_event_dispatcher.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // static 42 // static
43 void TooltipManagerAura::UpdateTooltipManagerForCapture(Widget* source) { 43 void TooltipManagerAura::UpdateTooltipManagerForCapture(Widget* source) {
44 if (!source->HasCapture()) 44 if (!source->HasCapture())
45 return; 45 return;
46 46
47 aura::Window* root_window = source->GetNativeView()->GetRootWindow(); 47 aura::Window* root_window = source->GetNativeView()->GetRootWindow();
48 if (!root_window) 48 if (!root_window)
49 return; 49 return;
50 50
51 gfx::Point screen_loc( 51 gfx::Point screen_loc(
52 root_window->GetDispatcher()->GetLastMouseLocationInRoot()); 52 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot());
53 aura::client::ScreenPositionClient* screen_position_client = 53 aura::client::ScreenPositionClient* screen_position_client =
54 aura::client::GetScreenPositionClient(root_window); 54 aura::client::GetScreenPositionClient(root_window);
55 if (!screen_position_client) 55 if (!screen_position_client)
56 return; 56 return;
57 screen_position_client->ConvertPointToScreen(root_window, &screen_loc); 57 screen_position_client->ConvertPointToScreen(root_window, &screen_loc);
58 gfx::Screen* screen = gfx::Screen::GetScreenFor(root_window); 58 gfx::Screen* screen = gfx::Screen::GetScreenFor(root_window);
59 aura::Window* target = screen->GetWindowAtScreenPoint(screen_loc); 59 aura::Window* target = screen->GetWindowAtScreenPoint(screen_loc);
60 if (!target) 60 if (!target)
61 return; 61 return;
62 gfx::Point target_loc(screen_loc); 62 gfx::Point target_loc(screen_loc);
(...skipping 21 matching lines...) Expand all
84 // TooltipManagerAura, TooltipManager implementation: 84 // TooltipManagerAura, TooltipManager implementation:
85 85
86 const gfx::FontList& TooltipManagerAura::GetFontList() const { 86 const gfx::FontList& TooltipManagerAura::GetFontList() const {
87 return GetDefaultFontList(); 87 return GetDefaultFontList();
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 gfx::Point view_point = 93 gfx::Point view_point =
94 root_window->GetDispatcher()->GetLastMouseLocationInRoot(); 94 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
95 aura::Window::ConvertPointToTarget(root_window, GetWindow(), &view_point); 95 aura::Window::ConvertPointToTarget(root_window, GetWindow(), &view_point);
96 View* view = GetViewUnderPoint(view_point); 96 View* view = GetViewUnderPoint(view_point);
97 UpdateTooltipForTarget(view, view_point, root_window); 97 UpdateTooltipForTarget(view, view_point, root_window);
98 } 98 }
99 } 99 }
100 100
101 void TooltipManagerAura::TooltipTextChanged(View* view) { 101 void TooltipManagerAura::TooltipTextChanged(View* view) {
102 aura::Window* root_window = GetWindow()->GetRootWindow(); 102 aura::Window* root_window = GetWindow()->GetRootWindow();
103 if (aura::client::GetTooltipClient(root_window)) { 103 if (aura::client::GetTooltipClient(root_window)) {
104 gfx::Point view_point = 104 gfx::Point view_point =
105 root_window->GetDispatcher()->GetLastMouseLocationInRoot(); 105 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
106 aura::Window::ConvertPointToTarget(root_window, GetWindow(), &view_point); 106 aura::Window::ConvertPointToTarget(root_window, GetWindow(), &view_point);
107 View* target = GetViewUnderPoint(view_point); 107 View* target = GetViewUnderPoint(view_point);
108 if (target != view) 108 if (target != view)
109 return; 109 return;
110 UpdateTooltipForTarget(view, view_point, root_window); 110 UpdateTooltipForTarget(view, view_point, root_window);
111 } 111 }
112 } 112 }
113 113
114 View* TooltipManagerAura::GetViewUnderPoint(const gfx::Point& point) { 114 View* TooltipManagerAura::GetViewUnderPoint(const gfx::Point& point) {
115 View* root_view = widget_->GetRootView(); 115 View* root_view = widget_->GetRootView();
(...skipping 17 matching lines...) Expand all
133 tooltip_text_.clear(); 133 tooltip_text_.clear();
134 } 134 }
135 aura::client::GetTooltipClient(root_window)->UpdateTooltip(GetWindow()); 135 aura::client::GetTooltipClient(root_window)->UpdateTooltip(GetWindow());
136 } 136 }
137 137
138 aura::Window* TooltipManagerAura::GetWindow() { 138 aura::Window* TooltipManagerAura::GetWindow() {
139 return widget_->GetNativeView(); 139 return widget_->GetNativeView();
140 } 140 }
141 141
142 } // namespace views. 142 } // namespace views.
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura_unittest.cc ('k') | ui/views/widget/widget_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698