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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_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: 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/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 GetTemplateURLForKeyword(keyword); 595 GetTemplateURLForKeyword(keyword);
596 if (template_url && template_url->IsExtensionKeyword()) { 596 if (template_url && template_url->IsExtensionKeyword()) {
597 const SkBitmap& bitmap = 597 const SkBitmap& bitmap =
598 profile_->GetExtensionService()->GetOmniboxIcon( 598 profile_->GetExtensionService()->GetOmniboxIcon(
599 template_url->GetExtensionId()); 599 template_url->GetExtensionId());
600 selected_keyword_view_->SetImage(bitmap); 600 selected_keyword_view_->SetImage(bitmap);
601 selected_keyword_view_->set_is_extension_icon(true); 601 selected_keyword_view_->set_is_extension_icon(true);
602 } else { 602 } else {
603 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 603 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
604 selected_keyword_view_->SetImage( 604 selected_keyword_view_->SetImage(
605 *rb.GetBitmapNamed(IDR_OMNIBOX_SEARCH)); 605 *rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH));
606 selected_keyword_view_->set_is_extension_icon(false); 606 selected_keyword_view_->set_is_extension_icon(false);
607 } 607 }
608 } 608 }
609 } else if (show_keyword_hint) { 609 } else if (show_keyword_hint) {
610 if (keyword_hint_view_->keyword() != keyword) 610 if (keyword_hint_view_->keyword() != keyword)
611 keyword_hint_view_->SetKeyword(keyword); 611 keyword_hint_view_->SetKeyword(keyword);
612 } 612 }
613 613
614 // Lay out items to the right of the edit field. 614 // Lay out items to the right of the edit field.
615 int offset = width() - kEdgeThickness - kEdgeItemPadding; 615 int offset = width() - kEdgeThickness - kEdgeItemPadding;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 } else { 866 } else {
867 // The navigation controller will delete the fetcher. 867 // The navigation controller will delete the fetcher.
868 } 868 }
869 } 869 }
870 } 870 }
871 } 871 }
872 } 872 }
873 873
874 void LocationBarView::OnChanged() { 874 void LocationBarView::OnChanged() {
875 location_icon_view_->SetImage( 875 location_icon_view_->SetImage(
876 ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( 876 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
877 location_entry_->GetIcon())); 877 location_entry_->GetIcon()));
878 location_icon_view_->ShowTooltip(!GetLocationEntry()->IsEditingOrEmpty()); 878 location_icon_view_->ShowTooltip(!GetLocationEntry()->IsEditingOrEmpty());
879 879
880 Layout(); 880 Layout();
881 SchedulePaint(); 881 SchedulePaint();
882 } 882 }
883 883
884 void LocationBarView::OnSelectionBoundsChanged() { 884 void LocationBarView::OnSelectionBoundsChanged() {
885 #if defined(OS_WIN) 885 #if defined(OS_WIN)
886 if (suggested_text_view_) 886 if (suggested_text_view_)
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && 1266 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() &&
1267 !suggested_text_view_->text().empty(); 1267 !suggested_text_view_->text().empty();
1268 } 1268 }
1269 1269
1270 #if !defined(USE_AURA) 1270 #if !defined(USE_AURA)
1271 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { 1271 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() {
1272 return static_cast<OmniboxViewWin*>(location_entry_.get()); 1272 return static_cast<OmniboxViewWin*>(location_entry_.get());
1273 } 1273 }
1274 #endif 1274 #endif
1275 #endif 1275 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698