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 14 matching lines...) Expand all Loading... | |
| 25 #include "chrome/browser/search/instant_service_factory.h" | 25 #include "chrome/browser/search/instant_service_factory.h" |
| 26 #include "chrome/browser/search/search.h" | 26 #include "chrome/browser/search/search.h" |
| 27 #include "chrome/browser/search_engines/template_url_service_factory.h" | 27 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 28 #include "chrome/browser/themes/theme_properties.h" | 28 #include "chrome/browser/themes/theme_properties.h" |
| 29 #include "chrome/browser/translate/chrome_translate_client.h" | 29 #include "chrome/browser/translate/chrome_translate_client.h" |
| 30 #include "chrome/browser/translate/translate_service.h" | 30 #include "chrome/browser/translate/translate_service.h" |
| 31 #include "chrome/browser/ui/browser.h" | 31 #include "chrome/browser/ui/browser.h" |
| 32 #include "chrome/browser/ui/browser_finder.h" | 32 #include "chrome/browser/ui/browser_finder.h" |
| 33 #include "chrome/browser/ui/browser_instant_controller.h" | 33 #include "chrome/browser/ui/browser_instant_controller.h" |
| 34 #include "chrome/browser/ui/browser_window.h" | 34 #include "chrome/browser/ui/browser_window.h" |
| 35 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | |
| 35 #include "chrome/browser/ui/passwords/manage_passwords_icon.h" | 36 #include "chrome/browser/ui/passwords/manage_passwords_icon.h" |
| 36 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 37 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 37 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 38 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 38 #include "chrome/browser/ui/view_ids.h" | 39 #include "chrome/browser/ui/view_ids.h" |
| 39 #include "chrome/browser/ui/views/browser_dialogs.h" | 40 #include "chrome/browser/ui/views/browser_dialogs.h" |
| 40 #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" | 41 #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" |
| 41 #include "chrome/browser/ui/views/location_bar/ev_bubble_view.h" | 42 #include "chrome/browser/ui/views/location_bar/ev_bubble_view.h" |
| 42 #include "chrome/browser/ui/views/location_bar/keyword_hint_view.h" | 43 #include "chrome/browser/ui/views/location_bar/keyword_hint_view.h" |
| 43 #include "chrome/browser/ui/views/location_bar/location_bar_layout.h" | 44 #include "chrome/browser/ui/views/location_bar/location_bar_layout.h" |
| 44 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 45 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 l10n_util::GetStringUTF16(IDS_TOOLTIP_MIC_SEARCH)); | 277 l10n_util::GetStringUTF16(IDS_TOOLTIP_MIC_SEARCH)); |
| 277 mic_search_view_->SetImage( | 278 mic_search_view_->SetImage( |
| 278 views::Button::STATE_NORMAL, | 279 views::Button::STATE_NORMAL, |
| 279 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 280 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 280 IDR_OMNIBOX_MIC_SEARCH)); | 281 IDR_OMNIBOX_MIC_SEARCH)); |
| 281 mic_search_view_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, | 282 mic_search_view_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
| 282 views::ImageButton::ALIGN_MIDDLE); | 283 views::ImageButton::ALIGN_MIDDLE); |
| 283 mic_search_view_->SetVisible(false); | 284 mic_search_view_->SetVisible(false); |
| 284 AddChildView(mic_search_view_); | 285 AddChildView(mic_search_view_); |
| 285 | 286 |
| 286 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { | 287 for (ContentSettingsType type : |
| 287 ContentSettingImageView* content_blocked_view = | 288 ContentSettingBubbleModel::GetSupportedBubbleTypes()) { |
|
tapted
2015/09/03 06:36:38
This is now iterating over fewer things right? (wa
raymes
2015/09/07 04:29:27
This stuff is all only used for bubbles. The scary
| |
| 288 new ContentSettingImageView(static_cast<ContentSettingsType>(i), this, | 289 ContentSettingImageView* content_blocked_view = new ContentSettingImageView( |
| 289 bubble_font_list, text_color, | 290 type, this, bubble_font_list, text_color, background_color); |
| 290 background_color); | |
| 291 content_setting_views_.push_back(content_blocked_view); | 291 content_setting_views_.push_back(content_blocked_view); |
| 292 content_blocked_view->SetVisible(false); | 292 content_blocked_view->SetVisible(false); |
| 293 AddChildView(content_blocked_view); | 293 AddChildView(content_blocked_view); |
| 294 } | 294 } |
| 295 | 295 |
| 296 zoom_view_ = new ZoomView(delegate_); | 296 zoom_view_ = new ZoomView(delegate_); |
| 297 AddChildView(zoom_view_); | 297 AddChildView(zoom_view_); |
| 298 | 298 |
| 299 open_pdf_in_reader_view_ = new OpenPDFInReaderView(); | 299 open_pdf_in_reader_view_ = new OpenPDFInReaderView(); |
| 300 AddChildView(open_pdf_in_reader_view_); | 300 AddChildView(open_pdf_in_reader_view_); |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1403 | 1403 |
| 1404 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1404 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1405 const SearchModel::State& new_state) { | 1405 const SearchModel::State& new_state) { |
| 1406 const bool visible = !GetToolbarModel()->input_in_progress() && | 1406 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1407 new_state.voice_search_supported; | 1407 new_state.voice_search_supported; |
| 1408 if (mic_search_view_->visible() != visible) { | 1408 if (mic_search_view_->visible() != visible) { |
| 1409 mic_search_view_->SetVisible(visible); | 1409 mic_search_view_->SetVisible(visible); |
| 1410 Layout(); | 1410 Layout(); |
| 1411 } | 1411 } |
| 1412 } | 1412 } |
| OLD | NEW |