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

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

Issue 2731123002: Fix some issues with OmniboxViewViews' use of OmniboxClient. (Closed)
Patch Set: Review comments Created 3 years, 9 months 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_view_views.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 14 matching lines...) Expand all
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_view_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698