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