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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 #if defined(OS_WIN) | 245 #if defined(OS_WIN) |
246 // On Windows use the software compositor to ensure that we don't block | 246 // On Windows use the software compositor to ensure that we don't block |
247 // the UI thread blocking issue during command buffer creation. We can | 247 // the UI thread blocking issue during command buffer creation. We can |
248 // revert this change once http://crbug.com/125248 is fixed. | 248 // revert this change once http://crbug.com/125248 is fixed. |
249 params.force_software_compositing = true; | 249 params.force_software_compositing = true; |
250 #endif | 250 #endif |
251 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 251 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
252 params.parent = popup_parent->GetNativeView(); | 252 params.parent = popup_parent->GetNativeView(); |
253 params.bounds = GetPopupBounds(); | 253 params.bounds = GetPopupBounds(); |
254 params.context = popup_parent->GetNativeWindow(); | 254 params.context = popup_parent->GetNativeWindow(); |
255 params.native_theme = popup_parent->GetNativeTheme(); | |
256 popup_->Init(params); | 255 popup_->Init(params); |
257 // Third-party software such as DigitalPersona identity verification can | 256 // Third-party software such as DigitalPersona identity verification can |
258 // hook the underlying window creation methods and use SendMessage to | 257 // hook the underlying window creation methods and use SendMessage to |
259 // synchronously change focus/activation, resulting in the popup being | 258 // synchronously change focus/activation, resulting in the popup being |
260 // destroyed by the time control returns here. Bail out in this case to | 259 // destroyed by the time control returns here. Bail out in this case to |
261 // avoid a NULL dereference. | 260 // avoid a NULL dereference. |
262 if (!popup_.get()) | 261 if (!popup_.get()) |
263 return; | 262 return; |
264 popup_->SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); | 263 popup_->SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); |
265 popup_->SetContentsView(this); | 264 popup_->SetContentsView(this); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 size_t index = GetIndexForPoint(event.location()); | 526 size_t index = GetIndexForPoint(event.location()); |
528 if (!HasMatchAt(index)) | 527 if (!HasMatchAt(index)) |
529 return; | 528 return; |
530 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, | 529 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, |
531 GURL(), base::string16(), index); | 530 GURL(), base::string16(), index); |
532 } | 531 } |
533 | 532 |
534 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 533 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
535 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 534 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
536 } | 535 } |
OLD | NEW |