OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/views/test/test_tooltip_client.h" | |
6 | |
7 #include "ui/base/resource/resource_bundle.h" | |
8 #include "ui/gfx/font.h" | |
9 #include "ui/gfx/point.h" | |
10 #include "ui/gfx/rect.h" | |
11 #include "ui/gfx/screen.h" | |
12 | |
13 namespace aura { | |
14 | |
15 // static | |
16 gfx::Font TooltipClient::GetDefaultFont() { | |
17 return ui::ResourceBundle::GetSharedInstance().GetFont( | |
18 ui::ResourceBundle::BaseFont); | |
19 } | |
20 | |
21 // static | |
22 int TooltipClient::GetMaxWidth(int x, int y) { | |
23 gfx::Rect monitor_bounds = | |
24 gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point(x, y)); | |
25 return (monitor_bounds.width() + 1) / 2; | |
26 } | |
27 | |
28 } // namespace aura | |
OLD | NEW |