| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include "app/drag_drop_types.h" | 11 #include "app/drag_drop_types.h" |
| 12 #include "app/l10n_util.h" | 12 #include "app/l10n_util.h" |
| 13 #include "app/resource_bundle.h" | 13 #include "app/resource_bundle.h" |
| 14 #include "app/theme_provider.h" | 14 #include "app/theme_provider.h" |
| 15 #include "chrome/app/chrome_dll_resource.h" | 15 #include "chrome/app/chrome_dll_resource.h" |
| 16 #include "chrome/browser/alternate_nav_url_fetcher.h" | 16 #include "chrome/browser/alternate_nav_url_fetcher.h" |
| 17 #include "chrome/browser/extensions/extension_browser_event_router.h" | 17 #include "chrome/browser/extensions/extension_browser_event_router.h" |
| 18 #include "chrome/browser/extensions/extensions_service.h" | 18 #include "chrome/browser/extensions/extensions_service.h" |
| 19 #include "chrome/browser/profile.h" | 19 #include "chrome/browser/profile.h" |
| 20 #include "chrome/browser/search_engines/template_url_model.h" | 20 #include "chrome/browser/search_engines/template_url_model.h" |
| 21 #include "chrome/browser/tab_contents/match_preview.h" |
| 21 #include "chrome/browser/view_ids.h" | 22 #include "chrome/browser/view_ids.h" |
| 22 #include "chrome/browser/views/browser_dialogs.h" | 23 #include "chrome/browser/views/browser_dialogs.h" |
| 23 #include "chrome/browser/views/location_bar/content_setting_image_view.h" | 24 #include "chrome/browser/views/location_bar/content_setting_image_view.h" |
| 24 #include "chrome/browser/views/location_bar/ev_bubble_view.h" | 25 #include "chrome/browser/views/location_bar/ev_bubble_view.h" |
| 25 #include "chrome/browser/views/location_bar/keyword_hint_view.h" | 26 #include "chrome/browser/views/location_bar/keyword_hint_view.h" |
| 26 #include "chrome/browser/views/location_bar/location_icon_view.h" | 27 #include "chrome/browser/views/location_bar/location_icon_view.h" |
| 27 #include "chrome/browser/views/location_bar/page_action_image_view.h" | 28 #include "chrome/browser/views/location_bar/page_action_image_view.h" |
| 28 #include "chrome/browser/views/location_bar/page_action_with_badge_view.h" | 29 #include "chrome/browser/views/location_bar/page_action_with_badge_view.h" |
| 29 #include "chrome/browser/views/location_bar/selected_keyword_view.h" | 30 #include "chrome/browser/views/location_bar/selected_keyword_view.h" |
| 30 #include "chrome/browser/views/location_bar/star_view.h" | 31 #include "chrome/browser/views/location_bar/star_view.h" |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 } | 705 } |
| 705 } | 706 } |
| 706 } | 707 } |
| 707 | 708 |
| 708 void LocationBarView::OnChanged() { | 709 void LocationBarView::OnChanged() { |
| 709 location_icon_view_->SetImage( | 710 location_icon_view_->SetImage( |
| 710 ResourceBundle::GetSharedInstance().GetBitmapNamed( | 711 ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 711 location_entry_->GetIcon())); | 712 location_entry_->GetIcon())); |
| 712 Layout(); | 713 Layout(); |
| 713 SchedulePaint(); | 714 SchedulePaint(); |
| 715 |
| 716 if (MatchPreview::IsEnabled() && GetTabContents() && |
| 717 !profile_->IsOffTheRecord()) { |
| 718 GURL url = location_entry_->model()->user_input_in_progress() ? |
| 719 location_entry_->model()->CurrentURL() : GURL(); |
| 720 GetTabContents()->match_preview()->Update(url); |
| 721 } |
| 714 } | 722 } |
| 715 | 723 |
| 716 void LocationBarView::OnInputInProgress(bool in_progress) { | 724 void LocationBarView::OnInputInProgress(bool in_progress) { |
| 717 delegate_->OnInputInProgress(in_progress); | 725 delegate_->OnInputInProgress(in_progress); |
| 718 } | 726 } |
| 719 | 727 |
| 720 void LocationBarView::OnKillFocus() { | 728 void LocationBarView::OnKillFocus() { |
| 721 } | 729 } |
| 722 | 730 |
| 723 void LocationBarView::OnSetFocus() { | 731 void LocationBarView::OnSetFocus() { |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 | 1061 |
| 1054 NOTREACHED(); | 1062 NOTREACHED(); |
| 1055 } | 1063 } |
| 1056 | 1064 |
| 1057 void LocationBarView::OnTemplateURLModelChanged() { | 1065 void LocationBarView::OnTemplateURLModelChanged() { |
| 1058 template_url_model_->RemoveObserver(this); | 1066 template_url_model_->RemoveObserver(this); |
| 1059 template_url_model_ = NULL; | 1067 template_url_model_ = NULL; |
| 1060 ShowFirstRunBubble(bubble_type_); | 1068 ShowFirstRunBubble(bubble_type_); |
| 1061 } | 1069 } |
| 1062 | 1070 |
| OLD | NEW |