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

Side by Side Diff: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc

Issue 271013002: Compute minimum widths for the toolbar components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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" 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"
15 #include "ui/views/painter.h" 14 #include "ui/views/painter.h"
16 15
17 16
18 IconLabelBubbleView::IconLabelBubbleView(const int background_images[], 17 IconLabelBubbleView::IconLabelBubbleView(const int background_images[],
19 const int hover_background_images[], 18 const int hover_background_images[],
20 int contained_image, 19 int contained_image,
21 const gfx::FontList& font_list, 20 const gfx::FontList& font_list,
22 SkColor text_color, 21 SkColor text_color,
23 SkColor parent_background_color, 22 SkColor parent_background_color,
24 bool elide_in_middle) 23 bool elide_in_middle)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 views::Painter* painter = (in_hover_ && hover_background_painter_) ? 121 views::Painter* painter = (in_hover_ && hover_background_painter_) ?
123 hover_background_painter_.get() : background_painter_.get(); 122 hover_background_painter_.get() : background_painter_.get();
124 painter->Paint(canvas, size()); 123 painter->Paint(canvas, size());
125 } 124 }
126 125
127 int IconLabelBubbleView::GetPreLabelWidth() const { 126 int IconLabelBubbleView::GetPreLabelWidth() const {
128 const int image_width = image_->GetPreferredSize().width(); 127 const int image_width = image_->GetPreferredSize().width();
129 return GetBubbleOuterPadding(true) + 128 return GetBubbleOuterPadding(true) +
130 (image_width ? (image_width + LocationBarView::kItemPadding) : 0); 129 (image_width ? (image_width + LocationBarView::kItemPadding) : 0);
131 } 130 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698