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 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 return was_visible != zoom_view_->visible(); | 1254 return was_visible != zoom_view_->visible(); |
1255 } | 1255 } |
1256 | 1256 |
1257 void LocationBarView::RefreshTranslateIcon() { | 1257 void LocationBarView::RefreshTranslateIcon() { |
1258 if (!TranslateService::IsTranslateBubbleEnabled()) | 1258 if (!TranslateService::IsTranslateBubbleEnabled()) |
1259 return; | 1259 return; |
1260 | 1260 |
1261 WebContents* web_contents = GetWebContents(); | 1261 WebContents* web_contents = GetWebContents(); |
1262 if (!web_contents) | 1262 if (!web_contents) |
1263 return; | 1263 return; |
1264 LanguageState& language_state = | 1264 translate::LanguageState& language_state = |
1265 ChromeTranslateClient::FromWebContents(web_contents)->GetLanguageState(); | 1265 ChromeTranslateClient::FromWebContents(web_contents)->GetLanguageState(); |
1266 bool enabled = language_state.translate_enabled(); | 1266 bool enabled = language_state.translate_enabled(); |
1267 command_updater()->UpdateCommandEnabled(IDC_TRANSLATE_PAGE, enabled); | 1267 command_updater()->UpdateCommandEnabled(IDC_TRANSLATE_PAGE, enabled); |
1268 translate_icon_view_->SetVisible(enabled); | 1268 translate_icon_view_->SetVisible(enabled); |
1269 translate_icon_view_->SetToggled(language_state.IsPageTranslated()); | 1269 translate_icon_view_->SetToggled(language_state.IsPageTranslated()); |
1270 } | 1270 } |
1271 | 1271 |
1272 bool LocationBarView::RefreshManagePasswordsIconView() { | 1272 bool LocationBarView::RefreshManagePasswordsIconView() { |
1273 DCHECK(manage_passwords_icon_view_); | 1273 DCHECK(manage_passwords_icon_view_); |
1274 WebContents* web_contents = GetWebContents(); | 1274 WebContents* web_contents = GetWebContents(); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1787 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
1788 const SearchModel::State& new_state) { | 1788 const SearchModel::State& new_state) { |
1789 const bool visible = !GetToolbarModel()->input_in_progress() && | 1789 const bool visible = !GetToolbarModel()->input_in_progress() && |
1790 new_state.voice_search_supported; | 1790 new_state.voice_search_supported; |
1791 if (mic_search_view_->visible() != visible) { | 1791 if (mic_search_view_->visible() != visible) { |
1792 mic_search_view_->SetVisible(visible); | 1792 mic_search_view_->SetVisible(visible); |
1793 Layout(); | 1793 Layout(); |
1794 } | 1794 } |
1795 } | 1795 } |
1796 | 1796 |
OLD | NEW |