| 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/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 const bool show_keyword_hint = !keyword.empty() && is_keyword_hint; | 712 const bool show_keyword_hint = !keyword.empty() && is_keyword_hint; |
| 713 selected_keyword_view_->SetVisible(show_selected_keyword); | 713 selected_keyword_view_->SetVisible(show_selected_keyword); |
| 714 keyword_hint_view_->SetVisible(show_keyword_hint); | 714 keyword_hint_view_->SetVisible(show_keyword_hint); |
| 715 if (show_selected_keyword) { | 715 if (show_selected_keyword) { |
| 716 if (selected_keyword_view_->keyword() != keyword) { | 716 if (selected_keyword_view_->keyword() != keyword) { |
| 717 selected_keyword_view_->SetKeyword(keyword); | 717 selected_keyword_view_->SetKeyword(keyword); |
| 718 const TemplateURL* template_url = | 718 const TemplateURL* template_url = |
| 719 TemplateURLServiceFactory::GetForProfile(profile_)-> | 719 TemplateURLServiceFactory::GetForProfile(profile_)-> |
| 720 GetTemplateURLForKeyword(keyword); | 720 GetTemplateURLForKeyword(keyword); |
| 721 if (template_url && template_url->IsExtensionKeyword()) { | 721 if (template_url && template_url->IsExtensionKeyword()) { |
| 722 const SkBitmap& bitmap = | 722 gfx::Image image = profile_->GetExtensionService()->GetOmniboxIcon( |
| 723 profile_->GetExtensionService()->GetOmniboxIcon( | 723 template_url->GetExtensionId()); |
| 724 template_url->GetExtensionId()); | 724 selected_keyword_view_->SetImage(image.AsImageSkia()); |
| 725 selected_keyword_view_->SetImage(bitmap); | |
| 726 selected_keyword_view_->set_is_extension_icon(true); | 725 selected_keyword_view_->set_is_extension_icon(true); |
| 727 } else { | 726 } else { |
| 728 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 727 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 729 selected_keyword_view_->SetImage( | 728 selected_keyword_view_->SetImage( |
| 730 *rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)); | 729 *rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)); |
| 731 selected_keyword_view_->set_is_extension_icon(false); | 730 selected_keyword_view_->set_is_extension_icon(false); |
| 732 } | 731 } |
| 733 } | 732 } |
| 734 } else if (show_keyword_hint) { | 733 } else if (show_keyword_hint) { |
| 735 if (keyword_hint_view_->keyword() != keyword) | 734 if (keyword_hint_view_->keyword() != keyword) |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 } | 1507 } |
| 1509 | 1508 |
| 1510 void LocationBarView::CleanupFadeAnimation() { | 1509 void LocationBarView::CleanupFadeAnimation() { |
| 1511 // Since we're no longer animating we don't need our layer. | 1510 // Since we're no longer animating we don't need our layer. |
| 1512 SetPaintToLayer(false); | 1511 SetPaintToLayer(false); |
| 1513 // Bubble labels don't need a transparent background anymore. | 1512 // Bubble labels don't need a transparent background anymore. |
| 1514 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1513 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1515 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1514 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1516 } | 1515 } |
| 1517 #endif // USE_AURA | 1516 #endif // USE_AURA |
| OLD | NEW |