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" | |
11 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
12 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
13 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
15 #include "chrome/app/chrome_command_ids.h" | 14 #include "chrome/app/chrome_command_ids.h" |
16 #include "chrome/browser/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.h" |
17 #include "chrome/browser/command_updater.h" | 16 #include "chrome/browser/command_updater.h" |
18 #include "chrome/browser/defaults.h" | 17 #include "chrome/browser/defaults.h" |
19 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 18 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
20 #include "chrome/browser/extensions/extension_action.h" | 19 #include "chrome/browser/extensions/extension_action.h" |
| 20 #include "chrome/browser/extensions/extension_util.h" |
21 #include "chrome/browser/extensions/location_bar_controller.h" | 21 #include "chrome/browser/extensions/location_bar_controller.h" |
22 #include "chrome/browser/extensions/tab_helper.h" | 22 #include "chrome/browser/extensions/tab_helper.h" |
23 #include "chrome/browser/favicon/favicon_tab_helper.h" | 23 #include "chrome/browser/favicon/favicon_tab_helper.h" |
24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/search/instant_service.h" | 25 #include "chrome/browser/search/instant_service.h" |
26 #include "chrome/browser/search/instant_service_factory.h" | 26 #include "chrome/browser/search/instant_service_factory.h" |
27 #include "chrome/browser/search/search.h" | 27 #include "chrome/browser/search/search.h" |
28 #include "chrome/browser/search_engines/template_url_service_factory.h" | 28 #include "chrome/browser/search_engines/template_url_service_factory.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" |
(...skipping 21 matching lines...) Expand all Loading... |
52 #include "chrome/browser/ui/views/location_bar/search_button.h" | 52 #include "chrome/browser/ui/views/location_bar/search_button.h" |
53 #include "chrome/browser/ui/views/location_bar/selected_keyword_view.h" | 53 #include "chrome/browser/ui/views/location_bar/selected_keyword_view.h" |
54 #include "chrome/browser/ui/views/location_bar/star_view.h" | 54 #include "chrome/browser/ui/views/location_bar/star_view.h" |
55 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h" | 55 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h" |
56 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" | 56 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
57 #include "chrome/browser/ui/views/location_bar/zoom_view.h" | 57 #include "chrome/browser/ui/views/location_bar/zoom_view.h" |
58 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" | 58 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
59 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" | 59 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" |
60 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" | 60 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" |
61 #include "chrome/browser/ui/zoom/zoom_controller.h" | 61 #include "chrome/browser/ui/zoom/zoom_controller.h" |
62 #include "chrome/common/chrome_switches.h" | |
63 #include "chrome/common/pref_names.h" | 62 #include "chrome/common/pref_names.h" |
64 #include "chrome/grit/generated_resources.h" | 63 #include "chrome/grit/generated_resources.h" |
65 #include "components/search_engines/template_url.h" | 64 #include "components/search_engines/template_url.h" |
66 #include "components/search_engines/template_url_service.h" | 65 #include "components/search_engines/template_url_service.h" |
67 #include "components/translate/core/browser/language_state.h" | 66 #include "components/translate/core/browser/language_state.h" |
68 #include "content/public/browser/notification_service.h" | 67 #include "content/public/browser/notification_service.h" |
69 #include "content/public/browser/render_widget_host_view.h" | 68 #include "content/public/browser/render_widget_host_view.h" |
70 #include "content/public/browser/web_contents.h" | 69 #include "content/public/browser/web_contents.h" |
71 #include "extensions/browser/extension_registry.h" | 70 #include "extensions/browser/extension_registry.h" |
72 #include "extensions/common/feature_switch.h" | 71 #include "extensions/common/feature_switch.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 ev_bubble_view_ = new EVBubbleView( | 294 ev_bubble_view_ = new EVBubbleView( |
296 bubble_font_list, GetColor(ToolbarModel::EV_SECURE, SECURITY_TEXT), | 295 bubble_font_list, GetColor(ToolbarModel::EV_SECURE, SECURITY_TEXT), |
297 background_color, this); | 296 background_color, this); |
298 ev_bubble_view_->set_drag_controller(this); | 297 ev_bubble_view_->set_drag_controller(this); |
299 AddChildView(ev_bubble_view_); | 298 AddChildView(ev_bubble_view_); |
300 | 299 |
301 // Initialize the Omnibox view. | 300 // Initialize the Omnibox view. |
302 omnibox_view_ = new OmniboxViewViews( | 301 omnibox_view_ = new OmniboxViewViews( |
303 this, profile(), command_updater(), | 302 this, profile(), command_updater(), |
304 is_popup_mode_ || | 303 is_popup_mode_ || |
305 (browser_->is_app() && CommandLine::ForCurrentProcess()-> | 304 (browser_->is_app() && |
306 HasSwitch(switches::kEnableStreamlinedHostedApps)), | 305 extensions::util::IsStreamlinedHostedAppsEnabled()), |
307 this, font_list); | 306 this, font_list); |
308 omnibox_view_->Init(); | 307 omnibox_view_->Init(); |
309 omnibox_view_->SetFocusable(true); | 308 omnibox_view_->SetFocusable(true); |
310 AddChildView(omnibox_view_); | 309 AddChildView(omnibox_view_); |
311 | 310 |
312 // Initialize the inline autocomplete view which is visible only when IME is | 311 // Initialize the inline autocomplete view which is visible only when IME is |
313 // turned on. Use the same font with the omnibox and highlighted background. | 312 // turned on. Use the same font with the omnibox and highlighted background. |
314 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); | 313 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); |
315 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 314 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
316 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); | 315 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); |
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 | 1714 |
1716 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1715 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
1717 const SearchModel::State& new_state) { | 1716 const SearchModel::State& new_state) { |
1718 const bool visible = !GetToolbarModel()->input_in_progress() && | 1717 const bool visible = !GetToolbarModel()->input_in_progress() && |
1719 new_state.voice_search_supported; | 1718 new_state.voice_search_supported; |
1720 if (mic_search_view_->visible() != visible) { | 1719 if (mic_search_view_->visible() != visible) { |
1721 mic_search_view_->SetVisible(visible); | 1720 mic_search_view_->SetVisible(visible); |
1722 Layout(); | 1721 Layout(); |
1723 } | 1722 } |
1724 } | 1723 } |
OLD | NEW |