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/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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 GetTemplateURLForKeyword(keyword); | 619 GetTemplateURLForKeyword(keyword); |
620 if (template_url && template_url->IsExtensionKeyword()) { | 620 if (template_url && template_url->IsExtensionKeyword()) { |
621 const SkBitmap& bitmap = | 621 const SkBitmap& bitmap = |
622 profile_->GetExtensionService()->GetOmniboxIcon( | 622 profile_->GetExtensionService()->GetOmniboxIcon( |
623 template_url->GetExtensionId()); | 623 template_url->GetExtensionId()); |
624 selected_keyword_view_->SetImage(bitmap); | 624 selected_keyword_view_->SetImage(bitmap); |
625 selected_keyword_view_->set_is_extension_icon(true); | 625 selected_keyword_view_->set_is_extension_icon(true); |
626 } else { | 626 } else { |
627 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 627 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
628 selected_keyword_view_->SetImage( | 628 selected_keyword_view_->SetImage( |
629 *rb.GetBitmapNamed(IDR_OMNIBOX_SEARCH)); | 629 *rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)); |
630 selected_keyword_view_->set_is_extension_icon(false); | 630 selected_keyword_view_->set_is_extension_icon(false); |
631 } | 631 } |
632 } | 632 } |
633 } else if (show_keyword_hint) { | 633 } else if (show_keyword_hint) { |
634 if (keyword_hint_view_->keyword() != keyword) | 634 if (keyword_hint_view_->keyword() != keyword) |
635 keyword_hint_view_->SetKeyword(keyword); | 635 keyword_hint_view_->SetKeyword(keyword); |
636 } | 636 } |
637 | 637 |
638 // Lay out items to the right of the edit field. | 638 // Lay out items to the right of the edit field. |
639 int offset = width() - kEdgeThickness - GetEdgeItemPadding(); | 639 int offset = width() - kEdgeThickness - GetEdgeItemPadding(); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 } else { | 898 } else { |
899 // The navigation controller will delete the fetcher. | 899 // The navigation controller will delete the fetcher. |
900 } | 900 } |
901 } | 901 } |
902 } | 902 } |
903 } | 903 } |
904 } | 904 } |
905 | 905 |
906 void LocationBarView::OnChanged() { | 906 void LocationBarView::OnChanged() { |
907 location_icon_view_->SetImage( | 907 location_icon_view_->SetImage( |
908 ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( | 908 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
909 location_entry_->GetIcon())); | 909 location_entry_->GetIcon())); |
910 location_icon_view_->ShowTooltip(!GetLocationEntry()->IsEditingOrEmpty()); | 910 location_icon_view_->ShowTooltip(!GetLocationEntry()->IsEditingOrEmpty()); |
911 | 911 |
912 Layout(); | 912 Layout(); |
913 SchedulePaint(); | 913 SchedulePaint(); |
914 } | 914 } |
915 | 915 |
916 void LocationBarView::OnSelectionBoundsChanged() { | 916 void LocationBarView::OnSelectionBoundsChanged() { |
917 #if defined(OS_WIN) | 917 #if defined(OS_WIN) |
918 if (suggested_text_view_) | 918 if (suggested_text_view_) |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1303 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
1304 !suggested_text_view_->text().empty(); | 1304 !suggested_text_view_->text().empty(); |
1305 } | 1305 } |
1306 | 1306 |
1307 #if !defined(USE_AURA) | 1307 #if !defined(USE_AURA) |
1308 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { | 1308 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { |
1309 return static_cast<OmniboxViewWin*>(location_entry_.get()); | 1309 return static_cast<OmniboxViewWin*>(location_entry_.get()); |
1310 } | 1310 } |
1311 #endif | 1311 #endif |
1312 #endif | 1312 #endif |
OLD | NEW |