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

Unified Diff: ui/views/test/test_tooltip_client.cc

Issue 8747022: Aura: Tooltips (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved test_tooltip_client to ui/views/test Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/test/test_tooltip_client.h ('k') | ui/views/widget/native_widget_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e7ea34d9e4f989edbca6d509b07c465a7c903217
--- /dev/null
+++ b/ui/views/test/test_tooltip_client.cc
@@ -0,0 +1,28 @@
+// 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 {
+
+// 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;
+}
+
+} // namespace aura
« no previous file with comments | « ui/views/test/test_tooltip_client.h ('k') | ui/views/widget/native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698