| OLD | NEW |
| 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 "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/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/views/controls/image_view.h" |
| 12 #include "ui/views/controls/label.h" | 13 #include "ui/views/controls/label.h" |
| 13 #include "views/controls/image_view.h" | |
| 14 | 14 |
| 15 // Amount of padding at the edges of the bubble. | 15 // Amount of padding at the edges of the bubble. |
| 16 static const int kBubbleOuterPadding = LocationBarView::kEdgeItemPadding - | 16 static const int kBubbleOuterPadding = LocationBarView::kEdgeItemPadding - |
| 17 LocationBarView::kBubbleHorizontalPadding; | 17 LocationBarView::kBubbleHorizontalPadding; |
| 18 | 18 |
| 19 // Amount of padding after the label. | 19 // Amount of padding after the label. |
| 20 static const int kLabelPadding = 5; | 20 static const int kLabelPadding = 5; |
| 21 | 21 |
| 22 IconLabelBubbleView::IconLabelBubbleView(const int background_images[], | 22 IconLabelBubbleView::IconLabelBubbleView(const int background_images[], |
| 23 int contained_image, | 23 int contained_image, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 int IconLabelBubbleView::GetPreLabelWidth() const { | 80 int IconLabelBubbleView::GetPreLabelWidth() const { |
| 81 return kBubbleOuterPadding + ResourceBundle::GetSharedInstance(). | 81 return kBubbleOuterPadding + ResourceBundle::GetSharedInstance(). |
| 82 GetBitmapNamed(IDR_OMNIBOX_SEARCH)->width() + | 82 GetBitmapNamed(IDR_OMNIBOX_SEARCH)->width() + |
| 83 LocationBarView::kItemPadding; | 83 LocationBarView::kItemPadding; |
| 84 } | 84 } |
| 85 | 85 |
| 86 int IconLabelBubbleView::GetNonLabelWidth() const { | 86 int IconLabelBubbleView::GetNonLabelWidth() const { |
| 87 return GetPreLabelWidth() + kBubbleOuterPadding; | 87 return GetPreLabelWidth() + kBubbleOuterPadding; |
| 88 } | 88 } |
| OLD | NEW |