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/omnibox_popup_non_view.h" | 9 #include "chrome/browser/ui/views/omnibox/omnibox_popup_non_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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 target_bounds_ = new_target_bounds; | 208 target_bounds_ = new_target_bounds; |
209 | 209 |
210 if (popup_ == NULL) { | 210 if (popup_ == NULL) { |
211 // If the popup is currently closed, we need to create it. | 211 // If the popup is currently closed, we need to create it. |
212 popup_ = (new AutocompletePopupWidget)->AsWeakPtr(); | 212 popup_ = (new AutocompletePopupWidget)->AsWeakPtr(); |
213 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 213 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
214 params.can_activate = false; | 214 params.can_activate = false; |
215 params.transparent = true; | 215 params.transparent = true; |
216 params.parent_widget = location_bar_->GetWidget(); | 216 params.parent_widget = location_bar_->GetWidget(); |
217 params.bounds = GetPopupBounds(); | 217 params.bounds = GetPopupBounds(); |
| 218 params.context = location_bar_->GetWidget()->GetNativeView(); |
218 popup_->Init(params); | 219 popup_->Init(params); |
219 #if defined(USE_ASH) | 220 #if defined(USE_ASH) |
220 ash::SetWindowVisibilityAnimationType( | 221 ash::SetWindowVisibilityAnimationType( |
221 popup_->GetNativeView(), | 222 popup_->GetNativeView(), |
222 ash::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); | 223 ash::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); |
223 // Meanie-pants designers won't let us animate the appearance in | 224 // Meanie-pants designers won't let us animate the appearance in |
224 // production, but we will do it anyway for desktop-aura for the time being | 225 // production, but we will do it anyway for desktop-aura for the time being |
225 // as it lets usverify quickly that hotness is enabled. | 226 // as it lets usverify quickly that hotness is enabled. |
226 #if defined(OS_CHROMEOS) | 227 #if defined(OS_CHROMEOS) |
227 // No animation for autocomplete popup appearance. | 228 // No animation for autocomplete popup appearance. |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 void OmniboxPopupContentsView::OpenSelectedLine( | 554 void OmniboxPopupContentsView::OpenSelectedLine( |
554 const ui::LocatedEvent& event, | 555 const ui::LocatedEvent& event, |
555 WindowOpenDisposition disposition) { | 556 WindowOpenDisposition disposition) { |
556 size_t index = GetIndexForPoint(event.location()); | 557 size_t index = GetIndexForPoint(event.location()); |
557 OpenIndex(index, disposition); | 558 OpenIndex(index, disposition); |
558 } | 559 } |
559 | 560 |
560 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 561 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
561 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 562 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
562 } | 563 } |
OLD | NEW |