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/themes/theme_properties.h" | 25 #include "chrome/browser/themes/theme_properties.h" |
26 #include "chrome/browser/themes/theme_service.h" | 26 #include "chrome/browser/themes/theme_service.h" |
27 #include "chrome/browser/translate/chrome_translate_client.h" | 27 #include "chrome/browser/translate/chrome_translate_client.h" |
28 #include "chrome/browser/translate/translate_service.h" | 28 #include "chrome/browser/translate/translate_service.h" |
29 #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h" | 29 #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h" |
30 #include "chrome/browser/ui/browser.h" | 30 #include "chrome/browser/ui/browser.h" |
31 #include "chrome/browser/ui/browser_finder.h" | 31 #include "chrome/browser/ui/browser_finder.h" |
32 #include "chrome/browser/ui/browser_window.h" | 32 #include "chrome/browser/ui/browser_window.h" |
33 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 33 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
34 #include "chrome/browser/ui/layout_constants.h" | 34 #include "chrome/browser/ui/layout_constants.h" |
| 35 #include "chrome/browser/ui/omnibox/chrome_omnibox_client.h" |
35 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 36 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
36 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 37 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
37 #include "chrome/browser/ui/views/autofill/save_card_icon_view.h" | 38 #include "chrome/browser/ui/views/autofill/save_card_icon_view.h" |
38 #include "chrome/browser/ui/views/frame/browser_view.h" | 39 #include "chrome/browser/ui/views/frame/browser_view.h" |
39 #include "chrome/browser/ui/views/location_bar/background_with_1_px_border.h" | 40 #include "chrome/browser/ui/views/location_bar/background_with_1_px_border.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/keyword_hint_view.h" | 42 #include "chrome/browser/ui/views/location_bar/keyword_hint_view.h" |
42 #include "chrome/browser/ui/views/location_bar/location_bar_layout.h" | 43 #include "chrome/browser/ui/views/location_bar/location_bar_layout.h" |
43 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 44 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
44 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" | 45 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 GetLayoutConstant(LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING); | 187 GetLayoutConstant(LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING); |
187 const int bubble_height = location_height - (bubble_padding * 2); | 188 const int bubble_height = location_height - (bubble_padding * 2); |
188 | 189 |
189 const SkColor background_color = GetColor(BACKGROUND); | 190 const SkColor background_color = GetColor(BACKGROUND); |
190 location_icon_view_ = new LocationIconView(font_list, this); | 191 location_icon_view_ = new LocationIconView(font_list, this); |
191 location_icon_view_->set_drag_controller(this); | 192 location_icon_view_->set_drag_controller(this); |
192 AddChildView(location_icon_view_); | 193 AddChildView(location_icon_view_); |
193 | 194 |
194 // Initialize the Omnibox view. | 195 // Initialize the Omnibox view. |
195 omnibox_view_ = new OmniboxViewViews( | 196 omnibox_view_ = new OmniboxViewViews( |
196 this, profile(), command_updater(), is_popup_mode_, this, font_list); | 197 this, base::MakeUnique<ChromeOmniboxClient>(this, profile()), |
| 198 command_updater(), is_popup_mode_, this, font_list); |
197 omnibox_view_->Init(); | 199 omnibox_view_->Init(); |
198 AddChildView(omnibox_view_); | 200 AddChildView(omnibox_view_); |
199 | 201 |
200 // Initialize the inline autocomplete view which is visible only when IME is | 202 // Initialize the inline autocomplete view which is visible only when IME is |
201 // turned on. Use the same font with the omnibox and highlighted background. | 203 // turned on. Use the same font with the omnibox and highlighted background. |
202 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); | 204 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); |
203 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 205 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
204 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); | 206 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); |
205 ime_inline_autocomplete_view_->set_background( | 207 ime_inline_autocomplete_view_->set_background( |
206 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( | 208 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( |
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 // LocationBarView, private TemplateURLServiceObserver implementation: | 1210 // LocationBarView, private TemplateURLServiceObserver implementation: |
1209 | 1211 |
1210 void LocationBarView::OnTemplateURLServiceChanged() { | 1212 void LocationBarView::OnTemplateURLServiceChanged() { |
1211 template_url_service_->RemoveObserver(this); | 1213 template_url_service_->RemoveObserver(this); |
1212 template_url_service_ = nullptr; | 1214 template_url_service_ = nullptr; |
1213 // If the browser is no longer active, let's not show the info bubble, as this | 1215 // If the browser is no longer active, let's not show the info bubble, as this |
1214 // would make the browser the active window again. | 1216 // would make the browser the active window again. |
1215 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1217 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
1216 ShowFirstRunBubble(); | 1218 ShowFirstRunBubble(); |
1217 } | 1219 } |
OLD | NEW |