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/ui/omnibox/omnibox_view.h" | 7 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
9 #include "chrome/browser/ui/views/omnibox/inline_omnibox_popup_view.h" | 9 #include "chrome/browser/ui/views/omnibox/inline_omnibox_popup_view.h" |
10 #include "chrome/browser/ui/views/omnibox/omnibox_result_view.h" | 10 #include "chrome/browser/ui/views/omnibox/omnibox_result_view.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // For some IMEs GetRelativeWindowForPopup triggers the omnibox to lose | 233 // For some IMEs GetRelativeWindowForPopup triggers the omnibox to lose |
234 // focus, thereby closing (and destroying) the popup. | 234 // focus, thereby closing (and destroying) the popup. |
235 // TODO(sky): this won't be needed once we close the omnibox on input | 235 // TODO(sky): this won't be needed once we close the omnibox on input |
236 // window showing. | 236 // window showing. |
237 return; | 237 return; |
238 } | 238 } |
239 popup_->Show(); | 239 popup_->Show(); |
240 } else { | 240 } else { |
241 // Animate the popup shrinking, but don't animate growing larger since that | 241 // Animate the popup shrinking, but don't animate growing larger since that |
242 // would make the popup feel less responsive. | 242 // would make the popup feel less responsive. |
243 start_bounds_ = GetWidget()->GetWindowScreenBounds(); | 243 start_bounds_ = GetWidget()->GetWindowBoundsInScreen(); |
244 if (target_bounds_.height() < start_bounds_.height()) | 244 if (target_bounds_.height() < start_bounds_.height()) |
245 size_animation_.Show(); | 245 size_animation_.Show(); |
246 else | 246 else |
247 start_bounds_ = target_bounds_; | 247 start_bounds_ = target_bounds_; |
248 popup_->SetBounds(GetPopupBounds()); | 248 popup_->SetBounds(GetPopupBounds()); |
249 } | 249 } |
250 | 250 |
251 SchedulePaint(); | 251 SchedulePaint(); |
252 } | 252 } |
253 | 253 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 if (HasMatchAt(index) && should_set_selected_line) | 547 if (HasMatchAt(index) && should_set_selected_line) |
548 model_->SetSelectedLine(index, false, false); | 548 model_->SetSelectedLine(index, false, false); |
549 } | 549 } |
550 | 550 |
551 void OmniboxPopupContentsView::OpenSelectedLine( | 551 void OmniboxPopupContentsView::OpenSelectedLine( |
552 const views::LocatedEvent& event, | 552 const views::LocatedEvent& event, |
553 WindowOpenDisposition disposition) { | 553 WindowOpenDisposition disposition) { |
554 size_t index = GetIndexForPoint(event.location()); | 554 size_t index = GetIndexForPoint(event.location()); |
555 OpenIndex(index, disposition); | 555 OpenIndex(index, disposition); |
556 } | 556 } |
OLD | NEW |