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

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

Issue 823133004: Cleanup: Update the path to gfx rect headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rect_f.h Created 5 years, 11 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
« no previous file with comments | « ui/views/widget/monitor_win.cc ('k') | ui/views/widget/tooltip_manager_aura.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) 2011 The Chromium Authors. All rights reserved. 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 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 "ui/views/widget/tooltip_manager.h" 5 #include "ui/views/widget/tooltip_manager.h"
6 6
7 #include "ui/gfx/rect.h" 7 #include "ui/gfx/geometry/rect.h"
8 #include "ui/gfx/screen.h" 8 #include "ui/gfx/screen.h"
9 #include "ui/gfx/text_elider.h" 9 #include "ui/gfx/text_elider.h"
10 10
11 namespace views { 11 namespace views {
12 12
13 const size_t kMaxTooltipLength = 1024; 13 const size_t kMaxTooltipLength = 1024;
14 14
15 // static 15 // static
16 const char TooltipManager::kGroupingPropertyKey[] = "GroupingPropertyKey"; 16 const char TooltipManager::kGroupingPropertyKey[] = "GroupingPropertyKey";
17 17
18 // static 18 // static
19 int TooltipManager::GetMaxWidth(int x, int y, gfx::NativeView context) { 19 int TooltipManager::GetMaxWidth(int x, int y, gfx::NativeView context) {
20 return GetMaxWidth(gfx::Screen::GetScreenFor(context)->GetDisplayNearestPoint( 20 return GetMaxWidth(gfx::Screen::GetScreenFor(context)->GetDisplayNearestPoint(
21 gfx::Point(x, y))); 21 gfx::Point(x, y)));
22 } 22 }
23 23
24 // static 24 // static
25 int TooltipManager::GetMaxWidth(const gfx::Display& display) { 25 int TooltipManager::GetMaxWidth(const gfx::Display& display) {
26 return (display.bounds().width() + 1) / 2; 26 return (display.bounds().width() + 1) / 2;
27 } 27 }
28 28
29 // static 29 // static
30 void TooltipManager::TrimTooltipText(base::string16* text) { 30 void TooltipManager::TrimTooltipText(base::string16* text) {
31 // Clamp the tooltip length to kMaxTooltipLength so that we don't 31 // Clamp the tooltip length to kMaxTooltipLength so that we don't
32 // accidentally DOS the user with a mega tooltip. 32 // accidentally DOS the user with a mega tooltip.
33 *text = gfx::TruncateString(*text, kMaxTooltipLength, gfx::WORD_BREAK); 33 *text = gfx::TruncateString(*text, kMaxTooltipLength, gfx::WORD_BREAK);
34 } 34 }
35 35
36 } // namespace views 36 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/monitor_win.cc ('k') | ui/views/widget/tooltip_manager_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698