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

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

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some new gfx::Screen additions Created 8 years, 2 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "ui/aura/client/tooltip_client.h" 6 #include "ui/aura/client/tooltip_client.h"
7 #include "ui/aura/root_window.h" 7 #include "ui/aura/root_window.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/font.h" 9 #include "ui/gfx/font.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
(...skipping 10 matching lines...) Expand all
21 return 0; 21 return 0;
22 } 22 }
23 23
24 // static 24 // static
25 gfx::Font TooltipManager::GetDefaultFont() { 25 gfx::Font TooltipManager::GetDefaultFont() {
26 return ui::ResourceBundle::GetSharedInstance().GetFont( 26 return ui::ResourceBundle::GetSharedInstance().GetFont(
27 ui::ResourceBundle::BaseFont); 27 ui::ResourceBundle::BaseFont);
28 } 28 }
29 29
30 // static 30 // static
31 int TooltipManager::GetMaxWidth(int x, int y) { 31 int TooltipManager::GetMaxWidth(int x, int y, gfx::NativeView context) {
32 gfx::Rect monitor_bounds = 32 gfx::Rect monitor_bounds =
33 gfx::Screen::GetDisplayNearestPoint(gfx::Point(x, y)).bounds(); 33 gfx::Screen::GetScreenFor(context)->GetDisplayNearestPoint(
34 gfx::Point(x, y)).bounds();
34 return (monitor_bounds.width() + 1) / 2; 35 return (monitor_bounds.width() + 1) / 2;
35 } 36 }
36 37
37 //////////////////////////////////////////////////////////////////////////////// 38 ////////////////////////////////////////////////////////////////////////////////
38 // TooltipManagerAura public: 39 // TooltipManagerAura public:
39 40
40 TooltipManagerAura::TooltipManagerAura(NativeWidgetAura* native_widget_aura) 41 TooltipManagerAura::TooltipManagerAura(NativeWidgetAura* native_widget_aura)
41 : native_widget_aura_(native_widget_aura) { 42 : native_widget_aura_(native_widget_aura) {
42 aura::client::SetTooltipText(native_widget_aura_->GetNativeView(), 43 aura::client::SetTooltipText(native_widget_aura_->GetNativeView(),
43 &tooltip_text_); 44 &tooltip_text_);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void TooltipManagerAura::HideKeyboardTooltip() { 96 void TooltipManagerAura::HideKeyboardTooltip() {
96 NOTREACHED(); 97 NOTREACHED();
97 } 98 }
98 99
99 View* TooltipManagerAura::GetViewUnderPoint(const gfx::Point& point) { 100 View* TooltipManagerAura::GetViewUnderPoint(const gfx::Point& point) {
100 View* root_view = native_widget_aura_->GetWidget()->GetRootView(); 101 View* root_view = native_widget_aura_->GetWidget()->GetRootView();
101 return root_view->GetEventHandlerForPoint(point); 102 return root_view->GetEventHandlerForPoint(point);
102 } 103 }
103 104
104 } // namespace views. 105 } // namespace views.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698