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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 width(), bottom_shadow_->height()); | 415 width(), bottom_shadow_->height()); |
416 } | 416 } |
417 | 417 |
418 void OmniboxPopupContentsView::PaintChildren(const ui::PaintContext& context) { | 418 void OmniboxPopupContentsView::PaintChildren(const ui::PaintContext& context) { |
419 gfx::Rect contents_bounds = GetContentsBounds(); | 419 gfx::Rect contents_bounds = GetContentsBounds(); |
420 contents_bounds.Inset(0, views::NonClientFrameView::kClientEdgeThickness, 0, | 420 contents_bounds.Inset(0, views::NonClientFrameView::kClientEdgeThickness, 0, |
421 bottom_shadow_->height() - kBorderInterior); | 421 bottom_shadow_->height() - kBorderInterior); |
422 | 422 |
423 gfx::Canvas* canvas = context.canvas(); | 423 gfx::Canvas* canvas = context.canvas(); |
424 canvas->Save(); | 424 canvas->Save(); |
425 canvas->sk_canvas()->clipRect(gfx::RectToSkRect(contents_bounds), | 425 canvas->ClipRect(contents_bounds); |
426 SkRegion::kIntersect_Op, | |
427 true /* doAntialias */); | |
428 canvas->DrawColor(result_view_at(0)->GetColor(OmniboxResultView::NORMAL, | 426 canvas->DrawColor(result_view_at(0)->GetColor(OmniboxResultView::NORMAL, |
429 OmniboxResultView::BACKGROUND)); | 427 OmniboxResultView::BACKGROUND)); |
430 View::PaintChildren(context); | 428 View::PaintChildren(context); |
431 canvas->Restore(); | 429 canvas->Restore(); |
432 } | 430 } |
433 | 431 |
434 //////////////////////////////////////////////////////////////////////////////// | 432 //////////////////////////////////////////////////////////////////////////////// |
435 // OmniboxPopupContentsView, private: | 433 // OmniboxPopupContentsView, private: |
436 | 434 |
437 views::View* OmniboxPopupContentsView::TargetForRect(views::View* root, | 435 views::View* OmniboxPopupContentsView::TargetForRect(views::View* root, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 size_t index = GetIndexForPoint(event.location()); | 479 size_t index = GetIndexForPoint(event.location()); |
482 if (!HasMatchAt(index)) | 480 if (!HasMatchAt(index)) |
483 return; | 481 return; |
484 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, | 482 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, |
485 GURL(), base::string16(), index); | 483 GURL(), base::string16(), index); |
486 } | 484 } |
487 | 485 |
488 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 486 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
489 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 487 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
490 } | 488 } |
OLD | NEW |