| 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/ui/omnibox/omnibox_popup_non_view.h" | 8 #include "chrome/browser/ui/omnibox/omnibox_popup_non_view.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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 int popup_height = 0; | 380 int popup_height = 0; |
| 381 for (size_t i = 0; i < model_->result().size(); ++i) | 381 for (size_t i = 0; i < model_->result().size(); ++i) |
| 382 popup_height += child_at(i)->GetPreferredSize().height(); | 382 popup_height += child_at(i)->GetPreferredSize().height(); |
| 383 return popup_height; | 383 return popup_height; |
| 384 } | 384 } |
| 385 | 385 |
| 386 OmniboxResultView* OmniboxPopupContentsView::CreateResultView( | 386 OmniboxResultView* OmniboxPopupContentsView::CreateResultView( |
| 387 OmniboxResultViewModel* model, | 387 OmniboxResultViewModel* model, |
| 388 int model_index, | 388 int model_index, |
| 389 const gfx::Font& font) { | 389 const gfx::Font& font) { |
| 390 return new OmniboxResultView(model, model_index, font); | 390 return new OmniboxResultView(model, model_index, location_bar_, font); |
| 391 } | 391 } |
| 392 | 392 |
| 393 //////////////////////////////////////////////////////////////////////////////// | 393 //////////////////////////////////////////////////////////////////////////////// |
| 394 // OmniboxPopupContentsView, views::View overrides, protected: | 394 // OmniboxPopupContentsView, views::View overrides, protected: |
| 395 | 395 |
| 396 void OmniboxPopupContentsView::OnPaint(gfx::Canvas* canvas) { | 396 void OmniboxPopupContentsView::OnPaint(gfx::Canvas* canvas) { |
| 397 gfx::Path path; | 397 gfx::Path path; |
| 398 MakeContentsPath(&path, GetContentsBounds()); | 398 MakeContentsPath(&path, GetContentsBounds()); |
| 399 canvas->Save(); | 399 canvas->Save(); |
| 400 canvas->sk_canvas()->clipPath(path, | 400 canvas->sk_canvas()->clipPath(path, |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 void OmniboxPopupContentsView::OpenSelectedLine( | 540 void OmniboxPopupContentsView::OpenSelectedLine( |
| 541 const ui::LocatedEvent& event, | 541 const ui::LocatedEvent& event, |
| 542 WindowOpenDisposition disposition) { | 542 WindowOpenDisposition disposition) { |
| 543 size_t index = GetIndexForPoint(event.location()); | 543 size_t index = GetIndexForPoint(event.location()); |
| 544 OpenIndex(index, disposition); | 544 OpenIndex(index, disposition); |
| 545 } | 545 } |
| 546 | 546 |
| 547 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 547 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
| 548 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 548 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
| 549 } | 549 } |
| OLD | NEW |