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

Side by Side Diff: ui/views/corewm/tooltip_aura.cc

Issue 864223004: Left-Align Tooltips (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/corewm/tooltip_aura.h" 5 #include "ui/views/corewm/tooltip_aura.h"
6 6
7 #include "base/strings/string_split.h" 7 #include "base/strings/string_split.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura/window_tree_host.h" 9 #include "ui/aura/window_tree_host.h"
10 #include "ui/gfx/screen.h" 10 #include "ui/gfx/screen.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 namespace views { 47 namespace views {
48 namespace corewm { 48 namespace corewm {
49 49
50 TooltipAura::TooltipAura(gfx::ScreenType screen_type) 50 TooltipAura::TooltipAura(gfx::ScreenType screen_type)
51 : screen_type_(screen_type), 51 : screen_type_(screen_type),
52 widget_(NULL), 52 widget_(NULL),
53 tooltip_window_(NULL) { 53 tooltip_window_(NULL) {
54 label_.set_owned_by_client(); 54 label_.set_owned_by_client();
55 label_.SetMultiLine(true); 55 label_.SetMultiLine(true);
56 label_.SetHorizontalAlignment(gfx::ALIGN_TO_HEAD);
56 57
57 const int kHorizontalPadding = 3; 58 const int kHorizontalPadding = 3;
58 const int kVerticalPadding = 2; 59 const int kVerticalPadding = 2;
59 label_.SetBorder(Border::CreateEmptyBorder( 60 label_.SetBorder(Border::CreateEmptyBorder(
60 kVerticalPadding, kHorizontalPadding, 61 kVerticalPadding, kHorizontalPadding,
61 kVerticalPadding, kHorizontalPadding)); 62 kVerticalPadding, kHorizontalPadding));
62 } 63 }
63 64
64 TooltipAura::~TooltipAura() { 65 TooltipAura::~TooltipAura() {
65 DestroyWidget(); 66 DestroyWidget();
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 230 }
230 231
231 void TooltipAura::OnWidgetDestroying(views::Widget* widget) { 232 void TooltipAura::OnWidgetDestroying(views::Widget* widget) {
232 DCHECK_EQ(widget_, widget); 233 DCHECK_EQ(widget_, widget);
233 widget_ = NULL; 234 widget_ = NULL;
234 tooltip_window_ = NULL; 235 tooltip_window_ = NULL;
235 } 236 }
236 237
237 } // namespace corewm 238 } // namespace corewm
238 } // namespace views 239 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698