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/search/search.h" | 7 #include "chrome/browser/search/search.h" |
8 #include "chrome/browser/themes/theme_properties.h" | 8 #include "chrome/browser/themes/theme_properties.h" |
9 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 9 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 300 |
301 void OmniboxPopupContentsView::Layout() { | 301 void OmniboxPopupContentsView::Layout() { |
302 // Size our children to the available content area. | 302 // Size our children to the available content area. |
303 LayoutChildren(); | 303 LayoutChildren(); |
304 | 304 |
305 // We need to manually schedule a paint here since we are a layered window and | 305 // We need to manually schedule a paint here since we are a layered window and |
306 // won't implicitly require painting until we ask for one. | 306 // won't implicitly require painting until we ask for one. |
307 SchedulePaint(); | 307 SchedulePaint(); |
308 } | 308 } |
309 | 309 |
310 views::View* OmniboxPopupContentsView::GetEventHandlerForPoint( | 310 views::View* OmniboxPopupContentsView::GetEventHandlerForRect( |
311 const gfx::Point& point) { | 311 const gfx::Rect& rect) { |
312 return this; | 312 return this; |
313 } | 313 } |
314 | 314 |
315 views::View* OmniboxPopupContentsView::GetTooltipHandlerForPoint( | 315 views::View* OmniboxPopupContentsView::GetTooltipHandlerForPoint( |
316 const gfx::Point& point) { | 316 const gfx::Point& point) { |
317 return NULL; | 317 return NULL; |
318 } | 318 } |
319 | 319 |
320 bool OmniboxPopupContentsView::OnMousePressed( | 320 bool OmniboxPopupContentsView::OnMousePressed( |
321 const ui::MouseEvent& event) { | 321 const ui::MouseEvent& event) { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 // OpenMatch() may close the popup, which will clear the result set and, by | 514 // OpenMatch() may close the popup, which will clear the result set and, by |
515 // extension, |match| and its contents. So copy the relevant match out to | 515 // extension, |match| and its contents. So copy the relevant match out to |
516 // make sure it stays alive until the call completes. | 516 // make sure it stays alive until the call completes. |
517 AutocompleteMatch match = model_->result().match_at(index); | 517 AutocompleteMatch match = model_->result().match_at(index); |
518 omnibox_view_->OpenMatch(match, disposition, GURL(), index); | 518 omnibox_view_->OpenMatch(match, disposition, GURL(), index); |
519 } | 519 } |
520 | 520 |
521 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 521 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
522 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 522 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
523 } | 523 } |
OLD | NEW |