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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" | 51 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" |
| 52 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" | 52 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" |
| 53 #include "chrome/browser/ui/views/location_bar/search_button.h" | 53 #include "chrome/browser/ui/views/location_bar/search_button.h" |
| 54 #include "chrome/browser/ui/views/location_bar/selected_keyword_view.h" | 54 #include "chrome/browser/ui/views/location_bar/selected_keyword_view.h" |
| 55 #include "chrome/browser/ui/views/location_bar/star_view.h" | 55 #include "chrome/browser/ui/views/location_bar/star_view.h" |
| 56 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h" | 56 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h" |
| 57 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" | 57 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
| 58 #include "chrome/browser/ui/views/location_bar/zoom_view.h" | 58 #include "chrome/browser/ui/views/location_bar/zoom_view.h" |
| 59 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" | 59 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
| 60 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" | 60 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" |
| 61 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" | |
| 61 #include "chrome/browser/ui/zoom/zoom_controller.h" | 62 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 62 #include "chrome/common/chrome_switches.h" | 63 #include "chrome/common/chrome_switches.h" |
| 63 #include "chrome/common/pref_names.h" | 64 #include "chrome/common/pref_names.h" |
| 64 #include "components/search_engines/template_url.h" | 65 #include "components/search_engines/template_url.h" |
| 65 #include "components/search_engines/template_url_service.h" | 66 #include "components/search_engines/template_url_service.h" |
| 66 #include "components/translate/core/browser/language_state.h" | 67 #include "components/translate/core/browser/language_state.h" |
| 67 #include "content/public/browser/notification_service.h" | 68 #include "content/public/browser/notification_service.h" |
| 68 #include "content/public/browser/render_widget_host_view.h" | 69 #include "content/public/browser/render_widget_host_view.h" |
| 69 #include "content/public/browser/web_contents.h" | 70 #include "content/public/browser/web_contents.h" |
| 70 #include "extensions/browser/extension_system.h" | 71 #include "extensions/browser/extension_system.h" |
| (...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1033 //////////////////////////////////////////////////////////////////////////////// | 1034 //////////////////////////////////////////////////////////////////////////////// |
| 1034 // LocationBarView, public OmniboxEditController implementation: | 1035 // LocationBarView, public OmniboxEditController implementation: |
| 1035 | 1036 |
| 1036 void LocationBarView::Update(const WebContents* contents) { | 1037 void LocationBarView::Update(const WebContents* contents) { |
| 1037 mic_search_view_->SetVisible( | 1038 mic_search_view_->SetVisible( |
| 1038 !GetToolbarModel()->input_in_progress() && browser_ && | 1039 !GetToolbarModel()->input_in_progress() && browser_ && |
| 1039 browser_->search_model()->voice_search_supported()); | 1040 browser_->search_model()->voice_search_supported()); |
| 1040 RefreshContentSettingViews(); | 1041 RefreshContentSettingViews(); |
| 1041 generated_credit_card_view_->Update(); | 1042 generated_credit_card_view_->Update(); |
| 1042 ZoomBubbleView::CloseBubble(); | 1043 ZoomBubbleView::CloseBubble(); |
| 1044 TranslateBubbleView::CloseBubble(); | |
|
sky
2014/07/31 15:53:19
Why is keying off LocationBarView::UPdate the righ
hajimehoshi
2014/08/01 09:46:06
It's because ZoomBubbleView seems to do the same t
sky
2014/08/04 18:44:26
I think you should listen for the tabstrip selecti
| |
| 1043 RefreshZoomView(); | 1045 RefreshZoomView(); |
| 1044 RefreshPageActionViews(); | 1046 RefreshPageActionViews(); |
| 1045 RefreshTranslateIcon(); | 1047 RefreshTranslateIcon(); |
| 1046 RefreshManagePasswordsIconView(); | 1048 RefreshManagePasswordsIconView(); |
| 1047 content::WebContents* web_contents_for_sub_views = | 1049 content::WebContents* web_contents_for_sub_views = |
| 1048 GetToolbarModel()->input_in_progress() ? NULL : GetWebContents(); | 1050 GetToolbarModel()->input_in_progress() ? NULL : GetWebContents(); |
| 1049 open_pdf_in_reader_view_->Update(web_contents_for_sub_views); | 1051 open_pdf_in_reader_view_->Update(web_contents_for_sub_views); |
| 1050 add_to_app_launcher_view_->Update(web_contents_for_sub_views); | 1052 add_to_app_launcher_view_->Update(web_contents_for_sub_views); |
| 1051 | 1053 |
| 1052 if (star_view_) { | 1054 if (star_view_) { |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1763 | 1765 |
| 1764 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1766 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1765 const SearchModel::State& new_state) { | 1767 const SearchModel::State& new_state) { |
| 1766 const bool visible = !GetToolbarModel()->input_in_progress() && | 1768 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1767 new_state.voice_search_supported; | 1769 new_state.voice_search_supported; |
| 1768 if (mic_search_view_->visible() != visible) { | 1770 if (mic_search_view_->visible() != visible) { |
| 1769 mic_search_view_->SetVisible(visible); | 1771 mic_search_view_->SetVisible(visible); |
| 1770 Layout(); | 1772 Layout(); |
| 1771 } | 1773 } |
| 1772 } | 1774 } |
| OLD | NEW |