Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 739793003: Close bubbles not on UpdateToolbar but when the activated tab is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move updating the zoom bubble; Move impelementation to OnActiveTabChanged Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 963
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();
Peter Kasting 2014/11/19 19:23:20 You deleted this, but didn't move it to anywhere e
hajimehoshi 2014/11/20 05:12:30 Oops, sorry. Moved like Translate bubble. Done.
974 TranslateBubbleView::CloseBubble();
975 RefreshZoomView(); 973 RefreshZoomView();
976 RefreshPageActionViews(); 974 RefreshPageActionViews();
977 RefreshTranslateIcon(); 975 RefreshTranslateIcon();
978 RefreshManagePasswordsIconView(); 976 RefreshManagePasswordsIconView();
979 content::WebContents* web_contents_for_sub_views = 977 content::WebContents* web_contents_for_sub_views =
980 GetToolbarModel()->input_in_progress() ? NULL : GetWebContents(); 978 GetToolbarModel()->input_in_progress() ? NULL : GetWebContents();
981 open_pdf_in_reader_view_->Update(web_contents_for_sub_views); 979 open_pdf_in_reader_view_->Update(web_contents_for_sub_views);
982 980
983 if (star_view_) 981 if (star_view_)
984 UpdateBookmarkStarVisibility(); 982 UpdateBookmarkStarVisibility();
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 1144
1147 WebContents* web_contents = GetWebContents(); 1145 WebContents* web_contents = GetWebContents();
1148 if (!web_contents) 1146 if (!web_contents)
1149 return; 1147 return;
1150 translate::LanguageState& language_state = 1148 translate::LanguageState& language_state =
1151 ChromeTranslateClient::FromWebContents(web_contents)->GetLanguageState(); 1149 ChromeTranslateClient::FromWebContents(web_contents)->GetLanguageState();
1152 bool enabled = language_state.translate_enabled(); 1150 bool enabled = language_state.translate_enabled();
1153 command_updater()->UpdateCommandEnabled(IDC_TRANSLATE_PAGE, enabled); 1151 command_updater()->UpdateCommandEnabled(IDC_TRANSLATE_PAGE, enabled);
1154 translate_icon_view_->SetVisible(enabled); 1152 translate_icon_view_->SetVisible(enabled);
1155 translate_icon_view_->SetToggled(language_state.IsPageTranslated()); 1153 translate_icon_view_->SetToggled(language_state.IsPageTranslated());
1154
1155 if (!enabled)
1156 TranslateBubbleView::CloseBubble();
1156 } 1157 }
1157 1158
1158 bool LocationBarView::RefreshManagePasswordsIconView() { 1159 bool LocationBarView::RefreshManagePasswordsIconView() {
1159 DCHECK(manage_passwords_icon_view_); 1160 DCHECK(manage_passwords_icon_view_);
1160 WebContents* web_contents = GetWebContents(); 1161 WebContents* web_contents = GetWebContents();
1161 if (!web_contents) 1162 if (!web_contents)
1162 return false; 1163 return false;
1163 const bool was_visible = manage_passwords_icon_view_->visible(); 1164 const bool was_visible = manage_passwords_icon_view_->visible();
1164 ManagePasswordsUIController::FromWebContents( 1165 ManagePasswordsUIController::FromWebContents(
1165 web_contents)->UpdateIconAndBubbleState(manage_passwords_icon_view_); 1166 web_contents)->UpdateIconAndBubbleState(manage_passwords_icon_view_);
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 1657
1657 void LocationBarView::ModelChanged(const SearchModel::State& old_state, 1658 void LocationBarView::ModelChanged(const SearchModel::State& old_state,
1658 const SearchModel::State& new_state) { 1659 const SearchModel::State& new_state) {
1659 const bool visible = !GetToolbarModel()->input_in_progress() && 1660 const bool visible = !GetToolbarModel()->input_in_progress() &&
1660 new_state.voice_search_supported; 1661 new_state.voice_search_supported;
1661 if (mic_search_view_->visible() != visible) { 1662 if (mic_search_view_->visible() != visible) {
1662 mic_search_view_->SetVisible(visible); 1663 mic_search_view_->SetVisible(visible);
1663 Layout(); 1664 Layout();
1664 } 1665 }
1665 } 1666 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698