Chromium Code Reviews| 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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 964 //////////////////////////////////////////////////////////////////////////////// | 964 //////////////////////////////////////////////////////////////////////////////// |
| 965 // LocationBarView, public OmniboxEditController implementation: | 965 // LocationBarView, public OmniboxEditController implementation: |
| 966 | 966 |
| 967 void LocationBarView::Update(const WebContents* contents) { | 967 void LocationBarView::Update(const WebContents* contents) { |
| 968 mic_search_view_->SetVisible( | 968 mic_search_view_->SetVisible( |
| 969 !GetToolbarModel()->input_in_progress() && browser_ && | 969 !GetToolbarModel()->input_in_progress() && browser_ && |
| 970 browser_->search_model()->voice_search_supported()); | 970 browser_->search_model()->voice_search_supported()); |
| 971 RefreshContentSettingViews(); | 971 RefreshContentSettingViews(); |
| 972 generated_credit_card_view_->Update(); | 972 generated_credit_card_view_->Update(); |
| 973 ZoomBubbleView::CloseBubble(); | 973 ZoomBubbleView::CloseBubble(); |
| 974 TranslateBubbleView::CloseBubble(); | |
|
Peter Kasting
2014/11/19 09:18:12
What about the other statements here, e.g. ZoomBub
hajimehoshi
2014/11/19 10:02:08
As to the zoom bubble, maybe yes, and I can update
| |
| 975 RefreshZoomView(); | 974 RefreshZoomView(); |
| 976 RefreshPageActionViews(); | 975 RefreshPageActionViews(); |
| 977 RefreshTranslateIcon(); | 976 RefreshTranslateIcon(); |
| 978 RefreshManagePasswordsIconView(); | 977 RefreshManagePasswordsIconView(); |
| 979 content::WebContents* web_contents_for_sub_views = | 978 content::WebContents* web_contents_for_sub_views = |
| 980 GetToolbarModel()->input_in_progress() ? NULL : GetWebContents(); | 979 GetToolbarModel()->input_in_progress() ? NULL : GetWebContents(); |
| 981 open_pdf_in_reader_view_->Update(web_contents_for_sub_views); | 980 open_pdf_in_reader_view_->Update(web_contents_for_sub_views); |
| 982 | 981 |
| 983 if (star_view_) | 982 if (star_view_) |
| 984 UpdateBookmarkStarVisibility(); | 983 UpdateBookmarkStarVisibility(); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1146 | 1145 |
| 1147 WebContents* web_contents = GetWebContents(); | 1146 WebContents* web_contents = GetWebContents(); |
| 1148 if (!web_contents) | 1147 if (!web_contents) |
| 1149 return; | 1148 return; |
| 1150 translate::LanguageState& language_state = | 1149 translate::LanguageState& language_state = |
| 1151 ChromeTranslateClient::FromWebContents(web_contents)->GetLanguageState(); | 1150 ChromeTranslateClient::FromWebContents(web_contents)->GetLanguageState(); |
| 1152 bool enabled = language_state.translate_enabled(); | 1151 bool enabled = language_state.translate_enabled(); |
| 1153 command_updater()->UpdateCommandEnabled(IDC_TRANSLATE_PAGE, enabled); | 1152 command_updater()->UpdateCommandEnabled(IDC_TRANSLATE_PAGE, enabled); |
| 1154 translate_icon_view_->SetVisible(enabled); | 1153 translate_icon_view_->SetVisible(enabled); |
| 1155 translate_icon_view_->SetToggled(language_state.IsPageTranslated()); | 1154 translate_icon_view_->SetToggled(language_state.IsPageTranslated()); |
| 1155 | |
| 1156 if (!enabled) | |
| 1157 TranslateBubbleView::CloseBubble(); | |
|
Peter Kasting
2014/11/19 09:18:12
Does this close the bubble when the main frame is
hajimehoshi
2014/11/19 10:02:08
Yes. When the main frame is navigated, |enabled| s
| |
| 1156 } | 1158 } |
| 1157 | 1159 |
| 1158 bool LocationBarView::RefreshManagePasswordsIconView() { | 1160 bool LocationBarView::RefreshManagePasswordsIconView() { |
| 1159 DCHECK(manage_passwords_icon_view_); | 1161 DCHECK(manage_passwords_icon_view_); |
| 1160 WebContents* web_contents = GetWebContents(); | 1162 WebContents* web_contents = GetWebContents(); |
| 1161 if (!web_contents) | 1163 if (!web_contents) |
| 1162 return false; | 1164 return false; |
| 1163 const bool was_visible = manage_passwords_icon_view_->visible(); | 1165 const bool was_visible = manage_passwords_icon_view_->visible(); |
| 1164 ManagePasswordsUIController::FromWebContents( | 1166 ManagePasswordsUIController::FromWebContents( |
| 1165 web_contents)->UpdateIconAndBubbleState(manage_passwords_icon_view_); | 1167 web_contents)->UpdateIconAndBubbleState(manage_passwords_icon_view_); |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1656 | 1658 |
| 1657 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1659 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1658 const SearchModel::State& new_state) { | 1660 const SearchModel::State& new_state) { |
| 1659 const bool visible = !GetToolbarModel()->input_in_progress() && | 1661 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1660 new_state.voice_search_supported; | 1662 new_state.voice_search_supported; |
| 1661 if (mic_search_view_->visible() != visible) { | 1663 if (mic_search_view_->visible() != visible) { |
| 1662 mic_search_view_->SetVisible(visible); | 1664 mic_search_view_->SetVisible(visible); |
| 1663 Layout(); | 1665 Layout(); |
| 1664 } | 1666 } |
| 1665 } | 1667 } |
| OLD | NEW |