OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" | 5 #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
11 #include "ui/gfx/canvas.h" | 11 #include "ui/gfx/canvas.h" |
12 #include "ui/gfx/color_utils.h" | 12 #include "ui/gfx/color_utils.h" |
13 #include "ui/views/controls/image_view.h" | 13 #include "ui/views/controls/image_view.h" |
14 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
15 #include "ui/views/painter.h" | 15 #include "ui/views/painter.h" |
16 | 16 |
17 | 17 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 void IconLabelBubbleView::OnPaint(gfx::Canvas* canvas) { | 102 void IconLabelBubbleView::OnPaint(gfx::Canvas* canvas) { |
103 background_painter_->Paint(canvas, size()); | 103 background_painter_->Paint(canvas, size()); |
104 } | 104 } |
105 | 105 |
106 int IconLabelBubbleView::GetPreLabelWidth() const { | 106 int IconLabelBubbleView::GetPreLabelWidth() const { |
107 const int image_width = image_->GetPreferredSize().width(); | 107 const int image_width = image_->GetPreferredSize().width(); |
108 return GetBubbleOuterPadding(true) + | 108 return GetBubbleOuterPadding(true) + |
109 (image_width ? (image_width + LocationBarView::GetItemPadding()) : 0); | 109 (image_width ? (image_width + LocationBarView::GetItemPadding()) : 0); |
110 } | 110 } |
OLD | NEW |