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/strings/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" | |
10 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
11 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
12 #include "ui/gfx/color_utils.h" | 11 #include "ui/gfx/color_utils.h" |
13 #include "ui/views/controls/image_view.h" | 12 #include "ui/views/controls/image_view.h" |
14 #include "ui/views/painter.h" | 13 #include "ui/views/painter.h" |
15 | 14 |
16 | 15 |
17 IconLabelBubbleView::IconLabelBubbleView(const int background_images[], | 16 IconLabelBubbleView::IconLabelBubbleView(const int background_images[], |
18 const int hover_background_images[], | 17 const int hover_background_images[], |
19 int contained_image, | 18 int contained_image, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 views::Painter* painter = (in_hover_ && hover_background_painter_) ? | 120 views::Painter* painter = (in_hover_ && hover_background_painter_) ? |
122 hover_background_painter_.get() : background_painter_.get(); | 121 hover_background_painter_.get() : background_painter_.get(); |
123 painter->Paint(canvas, size()); | 122 painter->Paint(canvas, size()); |
124 } | 123 } |
125 | 124 |
126 int IconLabelBubbleView::GetPreLabelWidth() const { | 125 int IconLabelBubbleView::GetPreLabelWidth() const { |
127 const int image_width = image_->GetPreferredSize().width(); | 126 const int image_width = image_->GetPreferredSize().width(); |
128 return GetBubbleOuterPadding(true) + | 127 return GetBubbleOuterPadding(true) + |
129 (image_width ? (image_width + LocationBarView::kItemPadding) : 0); | 128 (image_width ? (image_width + LocationBarView::kItemPadding) : 0); |
130 } | 129 } |
OLD | NEW |