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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 ev_bubble_view_ = new EVBubbleView( | 271 ev_bubble_view_ = new EVBubbleView( |
272 bubble_font_list, GetColor(ToolbarModel::EV_SECURE, SECURITY_TEXT), | 272 bubble_font_list, GetColor(ToolbarModel::EV_SECURE, SECURITY_TEXT), |
273 background_color, this); | 273 background_color, this); |
274 ev_bubble_view_->set_drag_controller(this); | 274 ev_bubble_view_->set_drag_controller(this); |
275 AddChildView(ev_bubble_view_); | 275 AddChildView(ev_bubble_view_); |
276 | 276 |
277 // Initialize the Omnibox view. | 277 // Initialize the Omnibox view. |
278 omnibox_view_ = new OmniboxViewViews(this, profile_, command_updater(), | 278 omnibox_view_ = new OmniboxViewViews(this, profile_, command_updater(), |
279 is_popup_mode_, this, font_list); | 279 is_popup_mode_, this, font_list); |
280 omnibox_view_->Init(); | 280 omnibox_view_->Init(); |
281 omnibox_view_->set_focusable(true); | 281 omnibox_view_->SetFocusable(true); |
282 AddChildView(omnibox_view_); | 282 AddChildView(omnibox_view_); |
283 | 283 |
284 // Initialize the inline autocomplete view which is visible only when IME is | 284 // Initialize the inline autocomplete view which is visible only when IME is |
285 // turned on. Use the same font with the omnibox and highlighted background. | 285 // turned on. Use the same font with the omnibox and highlighted background. |
286 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); | 286 ime_inline_autocomplete_view_ = new views::Label(base::string16(), font_list); |
287 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 287 ime_inline_autocomplete_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
288 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); | 288 ime_inline_autocomplete_view_->SetAutoColorReadabilityEnabled(false); |
289 ime_inline_autocomplete_view_->set_background( | 289 ime_inline_autocomplete_view_->set_background( |
290 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( | 290 views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor( |
291 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); | 291 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused))); |
(...skipping 17 matching lines...) Expand all Loading... |
309 AddChildView(suggested_text_view_); | 309 AddChildView(suggested_text_view_); |
310 | 310 |
311 keyword_hint_view_ = new KeywordHintView( | 311 keyword_hint_view_ = new KeywordHintView( |
312 profile_, font_list, | 312 profile_, font_list, |
313 GetColor(ToolbarModel::NONE, LocationBarView::DEEMPHASIZED_TEXT), | 313 GetColor(ToolbarModel::NONE, LocationBarView::DEEMPHASIZED_TEXT), |
314 background_color); | 314 background_color); |
315 AddChildView(keyword_hint_view_); | 315 AddChildView(keyword_hint_view_); |
316 | 316 |
317 mic_search_view_ = new views::ImageButton(this); | 317 mic_search_view_ = new views::ImageButton(this); |
318 mic_search_view_->set_id(VIEW_ID_MIC_SEARCH_BUTTON); | 318 mic_search_view_->set_id(VIEW_ID_MIC_SEARCH_BUTTON); |
319 mic_search_view_->set_accessibility_focusable(true); | 319 mic_search_view_->SetAccessibilityFocusable(true); |
320 mic_search_view_->SetTooltipText( | 320 mic_search_view_->SetTooltipText( |
321 l10n_util::GetStringUTF16(IDS_TOOLTIP_MIC_SEARCH)); | 321 l10n_util::GetStringUTF16(IDS_TOOLTIP_MIC_SEARCH)); |
322 mic_search_view_->SetImage( | 322 mic_search_view_->SetImage( |
323 views::Button::STATE_NORMAL, | 323 views::Button::STATE_NORMAL, |
324 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 324 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
325 IDR_OMNIBOX_MIC_SEARCH)); | 325 IDR_OMNIBOX_MIC_SEARCH)); |
326 mic_search_view_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, | 326 mic_search_view_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
327 views::ImageButton::ALIGN_MIDDLE); | 327 views::ImageButton::ALIGN_MIDDLE); |
328 mic_search_view_->SetVisible(false); | 328 mic_search_view_->SetVisible(false); |
329 InitTouchableLocationBarChildView(mic_search_view_); | 329 InitTouchableLocationBarChildView(mic_search_view_); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 AddChildView(translate_icon_view_); | 362 AddChildView(translate_icon_view_); |
363 | 363 |
364 star_view_ = new StarView(command_updater()); | 364 star_view_ = new StarView(command_updater()); |
365 star_view_->SetVisible(false); | 365 star_view_->SetVisible(false); |
366 AddChildView(star_view_); | 366 AddChildView(star_view_); |
367 | 367 |
368 search_button_ = new views::LabelButton(this, base::string16()); | 368 search_button_ = new views::LabelButton(this, base::string16()); |
369 search_button_->set_triggerable_event_flags( | 369 search_button_->set_triggerable_event_flags( |
370 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); | 370 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); |
371 search_button_->SetStyle(views::Button::STYLE_BUTTON); | 371 search_button_->SetStyle(views::Button::STYLE_BUTTON); |
372 search_button_->set_focusable(false); | 372 search_button_->SetFocusable(false); |
373 search_button_->set_min_size(gfx::Size()); | 373 search_button_->set_min_size(gfx::Size()); |
374 views::LabelButtonBorder* search_button_border = | 374 views::LabelButtonBorder* search_button_border = |
375 static_cast<views::LabelButtonBorder*>(search_button_->border()); | 375 static_cast<views::LabelButtonBorder*>(search_button_->border()); |
376 search_button_border->set_insets(gfx::Insets()); | 376 search_button_border->set_insets(gfx::Insets()); |
377 const int kSearchButtonNormalImages[] = IMAGE_GRID(IDR_OMNIBOX_SEARCH_BUTTON); | 377 const int kSearchButtonNormalImages[] = IMAGE_GRID(IDR_OMNIBOX_SEARCH_BUTTON); |
378 search_button_border->SetPainter( | 378 search_button_border->SetPainter( |
379 false, views::Button::STATE_NORMAL, | 379 false, views::Button::STATE_NORMAL, |
380 views::Painter::CreateImageGridPainter(kSearchButtonNormalImages)); | 380 views::Painter::CreateImageGridPainter(kSearchButtonNormalImages)); |
381 const int kSearchButtonHoveredImages[] = | 381 const int kSearchButtonHoveredImages[] = |
382 IMAGE_GRID(IDR_OMNIBOX_SEARCH_BUTTON_HOVER); | 382 IMAGE_GRID(IDR_OMNIBOX_SEARCH_BUTTON_HOVER); |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 i != extension_set->end(); ++i) { | 1582 i != extension_set->end(); ++i) { |
1583 const extensions::SettingsOverrides* settings_overrides = | 1583 const extensions::SettingsOverrides* settings_overrides = |
1584 extensions::SettingsOverrides::Get(i->get()); | 1584 extensions::SettingsOverrides::Get(i->get()); |
1585 if (settings_overrides && | 1585 if (settings_overrides && |
1586 settings_overrides->RequiresHideBookmarkButtonPermission()) | 1586 settings_overrides->RequiresHideBookmarkButtonPermission()) |
1587 return true; | 1587 return true; |
1588 } | 1588 } |
1589 | 1589 |
1590 return false; | 1590 return false; |
1591 } | 1591 } |
OLD | NEW |