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/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 const TemplateURL* template_url = | 635 const TemplateURL* template_url = |
636 TemplateURLServiceFactory::GetForProfile(profile())-> | 636 TemplateURLServiceFactory::GetForProfile(profile())-> |
637 GetTemplateURLForKeyword(keyword); | 637 GetTemplateURLForKeyword(keyword); |
638 if (template_url && | 638 if (template_url && |
639 (template_url->GetType() == TemplateURL::OMNIBOX_API_EXTENSION)) { | 639 (template_url->GetType() == TemplateURL::OMNIBOX_API_EXTENSION)) { |
640 gfx::Image image = extensions::OmniboxAPI::Get(profile())-> | 640 gfx::Image image = extensions::OmniboxAPI::Get(profile())-> |
641 GetOmniboxIcon(template_url->GetExtensionId()); | 641 GetOmniboxIcon(template_url->GetExtensionId()); |
642 selected_keyword_view_->SetImage(image.AsImageSkia()); | 642 selected_keyword_view_->SetImage(image.AsImageSkia()); |
643 selected_keyword_view_->set_is_extension_icon(true); | 643 selected_keyword_view_->set_is_extension_icon(true); |
644 } else { | 644 } else { |
645 selected_keyword_view_->SetImage( | 645 selected_keyword_view_->ResetImage(); |
646 *(GetThemeProvider()->GetImageSkiaNamed(IDR_OMNIBOX_SEARCH))); | |
647 selected_keyword_view_->set_is_extension_icon(false); | 646 selected_keyword_view_->set_is_extension_icon(false); |
648 } | 647 } |
649 } | 648 } |
650 } else if (ShouldShowEVBubble()) { | 649 } else if (ShouldShowEVBubble()) { |
651 ev_bubble_view_->SetLabel(GetToolbarModel()->GetEVCertName()); | 650 ev_bubble_view_->SetLabel(GetToolbarModel()->GetEVCertName()); |
652 // The largest fraction of the omnibox that can be taken by the EV bubble. | 651 // The largest fraction of the omnibox that can be taken by the EV bubble. |
653 const double kMaxBubbleFraction = 0.5; | 652 const double kMaxBubbleFraction = 0.5; |
654 leading_decorations.AddDecoration( | 653 leading_decorations.AddDecoration( |
655 bubble_vertical_padding, bubble_height, false, kMaxBubbleFraction, | 654 bubble_vertical_padding, bubble_height, false, kMaxBubbleFraction, |
656 bubble_horizontal_padding, item_padding, ev_bubble_view_); | 655 bubble_horizontal_padding, item_padding, ev_bubble_view_); |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 | 1417 |
1419 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1418 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
1420 const SearchModel::State& new_state) { | 1419 const SearchModel::State& new_state) { |
1421 const bool visible = !GetToolbarModel()->input_in_progress() && | 1420 const bool visible = !GetToolbarModel()->input_in_progress() && |
1422 new_state.voice_search_supported; | 1421 new_state.voice_search_supported; |
1423 if (mic_search_view_->visible() != visible) { | 1422 if (mic_search_view_->visible() != visible) { |
1424 mic_search_view_->SetVisible(visible); | 1423 mic_search_view_->SetVisible(visible); |
1425 Layout(); | 1424 Layout(); |
1426 } | 1425 } |
1427 } | 1426 } |
OLD | NEW |