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 |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 if (ShouldCommitMatchPreviewOnFocusLoss(view_gaining_focus)) | 739 if (ShouldCommitMatchPreviewOnFocusLoss(view_gaining_focus)) |
740 match_preview->CommitCurrentPreview(); | 740 match_preview->CommitCurrentPreview(); |
741 else | 741 else |
742 match_preview->DestroyPreviewContents(); | 742 match_preview->DestroyPreviewContents(); |
743 } | 743 } |
744 | 744 |
745 void LocationBarView::OnAutocompleteWillAccept() { | 745 void LocationBarView::OnAutocompleteWillAccept() { |
746 update_match_preview_ = false; | 746 update_match_preview_ = false; |
747 } | 747 } |
748 | 748 |
| 749 void LocationBarView::OnPopupBoundsChanged(const gfx::Rect& bounds) { |
| 750 MatchPreview* match_preview = delegate_->GetMatchPreview(); |
| 751 if (match_preview) |
| 752 match_preview->SetOmniboxBounds(bounds); |
| 753 } |
| 754 |
749 void LocationBarView::OnAutocompleteAccept( | 755 void LocationBarView::OnAutocompleteAccept( |
750 const GURL& url, | 756 const GURL& url, |
751 WindowOpenDisposition disposition, | 757 WindowOpenDisposition disposition, |
752 PageTransition::Type transition, | 758 PageTransition::Type transition, |
753 const GURL& alternate_nav_url) { | 759 const GURL& alternate_nav_url) { |
754 // WARNING: don't add an early return here. The calls after the if must | 760 // WARNING: don't add an early return here. The calls after the if must |
755 // happen. | 761 // happen. |
756 if (url.is_valid()) { | 762 if (url.is_valid()) { |
757 location_input_ = UTF8ToWide(url.spec()); | 763 location_input_ = UTF8ToWide(url.spec()); |
758 disposition_ = disposition; | 764 disposition_ = disposition; |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 view_gaining_focus_ancestor != rwhv_native_view) { | 1201 view_gaining_focus_ancestor != rwhv_native_view) { |
1196 view_gaining_focus_ancestor = ::GetParent(view_gaining_focus_ancestor); | 1202 view_gaining_focus_ancestor = ::GetParent(view_gaining_focus_ancestor); |
1197 } | 1203 } |
1198 return view_gaining_focus_ancestor != NULL; | 1204 return view_gaining_focus_ancestor != NULL; |
1199 #else | 1205 #else |
1200 // TODO: implement me. | 1206 // TODO: implement me. |
1201 NOTIMPLEMENTED(); | 1207 NOTIMPLEMENTED(); |
1202 return false; | 1208 return false; |
1203 #endif | 1209 #endif |
1204 } | 1210 } |
OLD | NEW |