Chromium Code Reviews| Index: ui/views/test/test_tooltip_client.cc |
| diff --git a/ui/views/test/test_tooltip_client.cc b/ui/views/test/test_tooltip_client.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cb2c605c946f0961edb3e7ed6bfdb427f0f87e66 |
| --- /dev/null |
| +++ b/ui/views/test/test_tooltip_client.cc |
| @@ -0,0 +1,32 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ui/views/test/test_tooltip_client.h" |
| + |
| +#include "ui/base/resource/resource_bundle.h" |
| +#include "ui/gfx/font.h" |
| +#include "ui/gfx/point.h" |
| +#include "ui/gfx/rect.h" |
| +#include "ui/gfx/screen.h" |
| + |
| +namespace aura { |
| + |
| +#if defined(USE_AURA) |
|
Ben Goodger (Google)
2011/12/01 17:55:40
we shouldn't be doing this in aura files.
Rather,
|
| + |
| +// static |
| +gfx::Font TooltipClient::GetDefaultFont() { |
| + return ui::ResourceBundle::GetSharedInstance().GetFont( |
| + ui::ResourceBundle::BaseFont); |
| +} |
| + |
| +// static |
| +int TooltipClient::GetMaxWidth(int x, int y) { |
| + gfx::Rect monitor_bounds = |
| + gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point(x, y)); |
| + return (monitor_bounds.width() + 1) / 2; |
| +} |
| + |
| +#endif |
| + |
| +} // namespace aura |