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