| 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/autocomplete/autocomplete_popup_contents_view.
h" | 5 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.
h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <commctrl.h> | 8 #include <commctrl.h> |
| 9 #include <dwmapi.h> | 9 #include <dwmapi.h> |
| 10 #include <objidl.h> | 10 #include <objidl.h> |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 ignore_mouse_drag_(false), | 91 ignore_mouse_drag_(false), |
| 92 ALLOW_THIS_IN_INITIALIZER_LIST(size_animation_(this)) { | 92 ALLOW_THIS_IN_INITIALIZER_LIST(size_animation_(this)) { |
| 93 // The following little dance is required because set_border() requires a | 93 // The following little dance is required because set_border() requires a |
| 94 // pointer to a non-const object. | 94 // pointer to a non-const object. |
| 95 views::BubbleBorder* bubble_border = | 95 views::BubbleBorder* bubble_border = |
| 96 new views::BubbleBorder(views::BubbleBorder::NONE, | 96 new views::BubbleBorder(views::BubbleBorder::NONE, |
| 97 views::BubbleBorder::NO_SHADOW); | 97 views::BubbleBorder::NO_SHADOW); |
| 98 bubble_border_ = bubble_border; | 98 bubble_border_ = bubble_border; |
| 99 set_border(bubble_border); | 99 set_border(bubble_border); |
| 100 // The contents is owned by the LocationBarView. | 100 // The contents is owned by the LocationBarView. |
| 101 set_parent_owned(false); | 101 set_owned_by_client(); |
| 102 | 102 |
| 103 for (size_t i = 0; i < AutocompleteResult::kMaxMatches; ++i) { | 103 for (size_t i = 0; i < AutocompleteResult::kMaxMatches; ++i) { |
| 104 AutocompleteResultView* result_view = | 104 AutocompleteResultView* result_view = |
| 105 CreateResultView(this, i, result_font_, result_bold_font_); | 105 CreateResultView(this, i, result_font_, result_bold_font_); |
| 106 result_view->SetVisible(false); | 106 result_view->SetVisible(false); |
| 107 AddChildViewAt(result_view, static_cast<int>(i)); | 107 AddChildViewAt(result_view, static_cast<int>(i)); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 AutocompletePopupContentsView::~AutocompletePopupContentsView() { | 111 AutocompletePopupContentsView::~AutocompletePopupContentsView() { |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // bubble appear at the same height as the Star bubble. | 511 // bubble appear at the same height as the Star bubble. |
| 512 location_bar_bounds.Inset(LocationBarView::kNormalHorizontalEdgeThickness, | 512 location_bar_bounds.Inset(LocationBarView::kNormalHorizontalEdgeThickness, |
| 513 0); | 513 0); |
| 514 } | 514 } |
| 515 gfx::Point location_bar_origin(location_bar_bounds.origin()); | 515 gfx::Point location_bar_origin(location_bar_bounds.origin()); |
| 516 views::View::ConvertPointToScreen(location_bar_, &location_bar_origin); | 516 views::View::ConvertPointToScreen(location_bar_, &location_bar_origin); |
| 517 location_bar_bounds.set_origin(location_bar_origin); | 517 location_bar_bounds.set_origin(location_bar_origin); |
| 518 return bubble_border_->GetBounds( | 518 return bubble_border_->GetBounds( |
| 519 location_bar_bounds, gfx::Size(location_bar_bounds.width(), h)); | 519 location_bar_bounds, gfx::Size(location_bar_bounds.width(), h)); |
| 520 } | 520 } |
| OLD | NEW |