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

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

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 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
« no previous file with comments | « ui/views/widget/native_widget_win.cc ('k') | ui/views/widget/tooltip_manager_win.cc » ('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 "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 12 matching lines...) Expand all
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) {
32 gfx::Rect monitor_bounds = 32 gfx::Rect monitor_bounds =
33 gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point(x, y)); 33 gfx::Screen::GetMonitorNearestPoint(gfx::Point(x, y)).bounds();
34 return (monitor_bounds.width() + 1) / 2; 34 return (monitor_bounds.width() + 1) / 2;
35 } 35 }
36 36
37 //////////////////////////////////////////////////////////////////////////////// 37 ////////////////////////////////////////////////////////////////////////////////
38 // TooltipManagerAura public: 38 // TooltipManagerAura public:
39 39
40 TooltipManagerAura::TooltipManagerAura(NativeWidgetAura* native_widget_aura) 40 TooltipManagerAura::TooltipManagerAura(NativeWidgetAura* native_widget_aura)
41 : native_widget_aura_(native_widget_aura) { 41 : native_widget_aura_(native_widget_aura) {
42 aura::client::SetTooltipText(native_widget_aura_->GetNativeView(), 42 aura::client::SetTooltipText(native_widget_aura_->GetNativeView(),
43 &tooltip_text_); 43 &tooltip_text_);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void TooltipManagerAura::HideKeyboardTooltip() { 95 void TooltipManagerAura::HideKeyboardTooltip() {
96 NOTREACHED(); 96 NOTREACHED();
97 } 97 }
98 98
99 View* TooltipManagerAura::GetViewUnderPoint(const gfx::Point& point) { 99 View* TooltipManagerAura::GetViewUnderPoint(const gfx::Point& point) {
100 View* root_view = native_widget_aura_->GetWidget()->GetRootView(); 100 View* root_view = native_widget_aura_->GetWidget()->GetRootView();
101 return root_view->GetEventHandlerForPoint(point); 101 return root_view->GetEventHandlerForPoint(point);
102 } 102 }
103 103
104 } // namespace views. 104 } // namespace views.
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_win.cc ('k') | ui/views/widget/tooltip_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698