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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 canvas->TileImageInt(*bottom_shadow_, 0, height() - bottom_shadow_->height(), | 457 canvas->TileImageInt(*bottom_shadow_, 0, height() - bottom_shadow_->height(), |
458 width(), bottom_shadow_->height()); | 458 width(), bottom_shadow_->height()); |
459 } | 459 } |
460 | 460 |
461 void OmniboxPopupContentsView::PaintChildren(const ui::PaintContext& context) { | 461 void OmniboxPopupContentsView::PaintChildren(const ui::PaintContext& context) { |
462 gfx::Rect contents_bounds = GetContentsBounds(); | 462 gfx::Rect contents_bounds = GetContentsBounds(); |
463 const int interior = GetLayoutConstant(OMNIBOX_DROPDOWN_BORDER_INTERIOR); | 463 const int interior = GetLayoutConstant(OMNIBOX_DROPDOWN_BORDER_INTERIOR); |
464 contents_bounds.Inset(0, views::NonClientFrameView::kClientEdgeThickness, 0, | 464 contents_bounds.Inset(0, views::NonClientFrameView::kClientEdgeThickness, 0, |
465 bottom_shadow_->height() - interior); | 465 bottom_shadow_->height() - interior); |
466 | 466 |
467 ui::ClipTransformRecorder clip_transform_recorder(context); | 467 ui::ClipTransformRecorder clip_transform_recorder(context, size()); |
468 clip_transform_recorder.ClipRect(contents_bounds); | 468 clip_transform_recorder.ClipRect(contents_bounds); |
469 { | 469 { |
470 ui::PaintRecorder recorder(context, size()); | 470 ui::PaintRecorder recorder(context, size()); |
471 SkColor background_color = result_view_at(0)->GetColor( | 471 SkColor background_color = result_view_at(0)->GetColor( |
472 OmniboxResultView::NORMAL, OmniboxResultView::BACKGROUND); | 472 OmniboxResultView::NORMAL, OmniboxResultView::BACKGROUND); |
473 recorder.canvas()->DrawColor(background_color); | 473 recorder.canvas()->DrawColor(background_color); |
474 } | 474 } |
475 View::PaintChildren(context); | 475 View::PaintChildren(context); |
476 } | 476 } |
477 | 477 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 size_t index = GetIndexForPoint(event.location()); | 525 size_t index = GetIndexForPoint(event.location()); |
526 if (!HasMatchAt(index)) | 526 if (!HasMatchAt(index)) |
527 return; | 527 return; |
528 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, | 528 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, |
529 GURL(), base::string16(), index); | 529 GURL(), base::string16(), index); |
530 } | 530 } |
531 | 531 |
532 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 532 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
533 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 533 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
534 } | 534 } |
OLD | NEW |