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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 const bool show_keyword_hint = !keyword.empty() && is_keyword_hint; | 758 const bool show_keyword_hint = !keyword.empty() && is_keyword_hint; |
759 selected_keyword_view_->SetVisible(show_selected_keyword); | 759 selected_keyword_view_->SetVisible(show_selected_keyword); |
760 keyword_hint_view_->SetVisible(show_keyword_hint); | 760 keyword_hint_view_->SetVisible(show_keyword_hint); |
761 if (show_selected_keyword) { | 761 if (show_selected_keyword) { |
762 if (selected_keyword_view_->keyword() != keyword) { | 762 if (selected_keyword_view_->keyword() != keyword) { |
763 selected_keyword_view_->SetKeyword(keyword); | 763 selected_keyword_view_->SetKeyword(keyword); |
764 const TemplateURL* template_url = | 764 const TemplateURL* template_url = |
765 TemplateURLServiceFactory::GetForProfile(profile_)-> | 765 TemplateURLServiceFactory::GetForProfile(profile_)-> |
766 GetTemplateURLForKeyword(keyword); | 766 GetTemplateURLForKeyword(keyword); |
767 if (template_url && template_url->IsExtensionKeyword()) { | 767 if (template_url && template_url->IsExtensionKeyword()) { |
768 gfx::Image image = profile_->GetExtensionService()->GetOmniboxIcon( | 768 gfx::Image image = extensions::ExtensionSystem::Get(profile_)-> |
769 template_url->GetExtensionId()); | 769 extension_service()->GetOmniboxIcon(template_url->GetExtensionId()); |
770 selected_keyword_view_->SetImage(image.AsImageSkia()); | 770 selected_keyword_view_->SetImage(image.AsImageSkia()); |
771 selected_keyword_view_->set_is_extension_icon(true); | 771 selected_keyword_view_->set_is_extension_icon(true); |
772 } else { | 772 } else { |
773 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 773 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
774 selected_keyword_view_->SetImage( | 774 selected_keyword_view_->SetImage( |
775 *rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)); | 775 *rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)); |
776 selected_keyword_view_->set_is_extension_icon(false); | 776 selected_keyword_view_->set_is_extension_icon(false); |
777 } | 777 } |
778 } | 778 } |
779 } else if (show_keyword_hint) { | 779 } else if (show_keyword_hint) { |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 int LocationBarView::GetInternalHeight(bool use_preferred_size) { | 1571 int LocationBarView::GetInternalHeight(bool use_preferred_size) { |
1572 int total_height = | 1572 int total_height = |
1573 use_preferred_size ? GetPreferredSize().height() : height(); | 1573 use_preferred_size ? GetPreferredSize().height() : height(); |
1574 return std::max(total_height - (kVerticalEdgeThickness * 2), 0); | 1574 return std::max(total_height - (kVerticalEdgeThickness * 2), 0); |
1575 } | 1575 } |
1576 | 1576 |
1577 bool LocationBarView::HasValidSuggestText() const { | 1577 bool LocationBarView::HasValidSuggestText() const { |
1578 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1578 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
1579 !suggested_text_view_->text().empty(); | 1579 !suggested_text_view_->text().empty(); |
1580 } | 1580 } |
OLD | NEW |