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/omnibox/omnibox_popup_contents_view.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" |
6 | 6 |
7 #include "chrome/browser/search/search.h" | 7 #include "chrome/browser/search/search.h" |
8 #include "chrome/browser/themes/theme_properties.h" | 8 #include "chrome/browser/themes/theme_properties.h" |
9 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 9 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 #endif | 219 #endif |
220 popup_->SetContentsView(this); | 220 popup_->SetContentsView(this); |
221 popup_->StackAbove(omnibox_view_->GetRelativeWindowForPopup()); | 221 popup_->StackAbove(omnibox_view_->GetRelativeWindowForPopup()); |
222 if (!popup_.get()) { | 222 if (!popup_.get()) { |
223 // For some IMEs GetRelativeWindowForPopup triggers the omnibox to lose | 223 // For some IMEs GetRelativeWindowForPopup triggers the omnibox to lose |
224 // focus, thereby closing (and destroying) the popup. | 224 // focus, thereby closing (and destroying) the popup. |
225 // TODO(sky): this won't be needed once we close the omnibox on input | 225 // TODO(sky): this won't be needed once we close the omnibox on input |
226 // window showing. | 226 // window showing. |
227 return; | 227 return; |
228 } | 228 } |
229 popup_->Show(); | 229 popup_->ShowInactive(); |
230 } else { | 230 } else { |
231 // Animate the popup shrinking, but don't animate growing larger since that | 231 // Animate the popup shrinking, but don't animate growing larger since that |
232 // would make the popup feel less responsive. | 232 // would make the popup feel less responsive. |
233 start_bounds_ = GetWidget()->GetWindowBoundsInScreen(); | 233 start_bounds_ = GetWidget()->GetWindowBoundsInScreen(); |
234 if (target_bounds_.height() < start_bounds_.height()) | 234 if (target_bounds_.height() < start_bounds_.height()) |
235 size_animation_.Show(); | 235 size_animation_.Show(); |
236 else | 236 else |
237 start_bounds_ = target_bounds_; | 237 start_bounds_ = target_bounds_; |
238 popup_->SetBounds(GetPopupBounds()); | 238 popup_->SetBounds(GetPopupBounds()); |
239 } | 239 } |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 size_t index = GetIndexForPoint(event.location()); | 496 size_t index = GetIndexForPoint(event.location()); |
497 if (!HasMatchAt(index)) | 497 if (!HasMatchAt(index)) |
498 return; | 498 return; |
499 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, | 499 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, |
500 GURL(), index); | 500 GURL(), index); |
501 } | 501 } |
502 | 502 |
503 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 503 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
504 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 504 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
505 } | 505 } |
OLD | NEW |