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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 if (ShouldShowKeywordBubble()) { | 595 if (ShouldShowKeywordBubble()) { |
596 leading_decorations.AddDecoration(vertical_padding, location_height, true, | 596 leading_decorations.AddDecoration(vertical_padding, location_height, true, |
597 0, bubble_horizontal_padding, | 597 0, bubble_horizontal_padding, |
598 item_padding, selected_keyword_view_); | 598 item_padding, selected_keyword_view_); |
599 if (selected_keyword_view_->keyword() != keyword) { | 599 if (selected_keyword_view_->keyword() != keyword) { |
600 selected_keyword_view_->SetKeyword(keyword); | 600 selected_keyword_view_->SetKeyword(keyword); |
601 const TemplateURL* template_url = | 601 const TemplateURL* template_url = |
602 TemplateURLServiceFactory::GetForProfile(profile())-> | 602 TemplateURLServiceFactory::GetForProfile(profile())-> |
603 GetTemplateURLForKeyword(keyword); | 603 GetTemplateURLForKeyword(keyword); |
604 if (template_url && | 604 if (template_url && |
605 (template_url->GetType() == TemplateURL::OMNIBOX_API_EXTENSION)) { | 605 (template_url->type() == TemplateURL::OMNIBOX_API_EXTENSION)) { |
606 gfx::Image image = extensions::OmniboxAPI::Get(profile())-> | 606 gfx::Image image = extensions::OmniboxAPI::Get(profile())-> |
607 GetOmniboxIcon(template_url->GetExtensionId()); | 607 GetOmniboxIcon(template_url->GetExtensionId()); |
608 selected_keyword_view_->SetImage(image.AsImageSkia()); | 608 selected_keyword_view_->SetImage(image.AsImageSkia()); |
609 selected_keyword_view_->set_is_extension_icon(true); | 609 selected_keyword_view_->set_is_extension_icon(true); |
610 } else { | 610 } else { |
611 selected_keyword_view_->ResetImage(); | 611 selected_keyword_view_->ResetImage(); |
612 selected_keyword_view_->set_is_extension_icon(false); | 612 selected_keyword_view_->set_is_extension_icon(false); |
613 } | 613 } |
614 } | 614 } |
615 } else if (ShouldShowSecurityChip()) { | 615 } else if (ShouldShowSecurityChip()) { |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 // LocationBarView, private TemplateURLServiceObserver implementation: | 1397 // LocationBarView, private TemplateURLServiceObserver implementation: |
1398 | 1398 |
1399 void LocationBarView::OnTemplateURLServiceChanged() { | 1399 void LocationBarView::OnTemplateURLServiceChanged() { |
1400 template_url_service_->RemoveObserver(this); | 1400 template_url_service_->RemoveObserver(this); |
1401 template_url_service_ = nullptr; | 1401 template_url_service_ = nullptr; |
1402 // If the browser is no longer active, let's not show the info bubble, as this | 1402 // If the browser is no longer active, let's not show the info bubble, as this |
1403 // would make the browser the active window again. | 1403 // would make the browser the active window again. |
1404 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1404 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
1405 ShowFirstRunBubble(); | 1405 ShowFirstRunBubble(); |
1406 } | 1406 } |
OLD | NEW |