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

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

Issue 10382144: Change SetImage, SetBackground, and SetToggledImage to take in a gfx::ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 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/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"
(...skipping 19 matching lines...) Expand all
30 30
31 } // namespace 31 } // namespace
32 32
33 IconLabelBubbleView::IconLabelBubbleView(const int background_images[], 33 IconLabelBubbleView::IconLabelBubbleView(const int background_images[],
34 int contained_image, 34 int contained_image,
35 SkColor color) 35 SkColor color)
36 : background_painter_(background_images), 36 : background_painter_(background_images),
37 is_extension_icon_(false) { 37 is_extension_icon_(false) {
38 image_ = new views::ImageView(); 38 image_ = new views::ImageView();
39 image_->SetImage( 39 image_->SetImage(
40 ui::ResourceBundle::GetSharedInstance().GetBitmapNamed(contained_image)); 40 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
41 contained_image));
41 AddChildView(image_); 42 AddChildView(image_);
42 43
43 label_ = new views::Label(); 44 label_ = new views::Label();
44 label_->SetAutoColorReadabilityEnabled(false); 45 label_->SetAutoColorReadabilityEnabled(false);
45 label_->SetEnabledColor(color); 46 label_->SetEnabledColor(color);
46 AddChildView(label_); 47 AddChildView(label_);
47 } 48 }
48 49
49 IconLabelBubbleView::~IconLabelBubbleView() { 50 IconLabelBubbleView::~IconLabelBubbleView() {
50 } 51 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 int IconLabelBubbleView::GetPreLabelWidth() const { 92 int IconLabelBubbleView::GetPreLabelWidth() const {
92 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 93 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
93 return GetBubbleOuterPadding() + 94 return GetBubbleOuterPadding() +
94 rb.GetBitmapNamed(IDR_OMNIBOX_SEARCH)->width() + 95 rb.GetBitmapNamed(IDR_OMNIBOX_SEARCH)->width() +
95 LocationBarView::GetItemPadding(); 96 LocationBarView::GetItemPadding();
96 } 97 }
97 98
98 int IconLabelBubbleView::GetNonLabelWidth() const { 99 int IconLabelBubbleView::GetNonLabelWidth() const {
99 return GetPreLabelWidth() + GetBubbleOuterPadding(); 100 return GetPreLabelWidth() + GetBubbleOuterPadding();
100 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698